[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6915) Restrictions.ilike(String propertyValue, Object value) does not correctly initialize LikeExpresison

Jakub Królikowski (JIRA) noreply at atlassian.com
Sun Mar 25 20:40:48 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-6915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46070#comment-46070 ] 

Jakub Królikowski commented on HHH-6915:
----------------------------------------

This is a very serious bug, but very simple to fix.

Restrictions.ilike(String propertyName, Object value)
creates new LikeExpression(propertyName, value.toString())
where ignoreCase is set on false - should be on true.



> Restrictions.ilike(String propertyValue, Object value) does not correctly initialize LikeExpresison
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HHH-6915
>                 URL: https://hibernate.onjira.com/browse/HHH-6915
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.Final
>            Reporter: Martin Kartumovich
>            Priority: Minor
>              Labels: criteria
>
> The method Restrictions.ilike(String propertyValue, Object value) uses the LikeExpression-Constructor LikeExpression(propertyName, value.toString()) which will initialize the LikeExpression with "ignoreCase = false".
> The resulting SQL shows a normal "xyz like ?" instead of the expected "lower(xyz) like lower(?)" (i.e. Oracle10gDialect).
> This issue seems to have been introduced with HHH-4943.
> Workaround: Use Restrictions.ilike(String propertyValue, Object value, MatchMode mode). This will correctly initialize LikeExpression with "ignoreCase = true".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list