[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2997) LikeExpression case sensitive not working properly

Christian Jaeger (JIRA) noreply at atlassian.com
Thu Mar 18 10:42:35 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35878#action_35878 ] 

Christian Jaeger commented on HHH-2997:
---------------------------------------

Albert is right - the problem lies in org.hibernate.criterion.LikeExpression:
in getTypedValues, the value is always converted to lower case, even if the search should be case-sensitive.

This problem still isn't fixed in version 3.5.0.

This is a major issue on databases where "like" queries always search case-sensitive (e.g. on Oracle). On these databases, if ignoreCase = false, LikeExpression will currently EXCLUDE any results with uppercase letters.
You won't recognize the difference on databases that don't search case-sensitive, e.g. MS Sql Server).

> LikeExpression case sensitive not working properly
> --------------------------------------------------
>
>                 Key: HHH-2997
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2997
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5
>            Reporter: Adam Czysciak
>            Priority: Minor
>         Attachments: hibernate2997test.zip, LikeExpression.patch, LikeExpression.patch
>
>
> LikeExpression doesn't handle ignoreCase flag properly when it's set to false. Uses it to build correct sql "property like ?", but doesn't use the flag inside getTypedValues - produces always lowercase value to bind.
> Attached a patch for 3.2.5

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list