[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2779) Column value incorrectly enclosed in square brackets in SQL generated by Hibernate when using Restrictions.ne with ignoreCase()

Diego Pires Plentz (JIRA) noreply at atlassian.com
Tue Aug 14 13:40:13 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27818 ] 

Diego Pires Plentz commented on HHH-2779:
-----------------------------------------

Please, provide a testcase with mappings plus query as you are doing.

> Column value incorrectly enclosed in square brackets in SQL generated by Hibernate when using Restrictions.ne with ignoreCase()
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-2779
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2779
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.1.3
>         Environment: Both MySQL and Oracle, Java 5.0
>            Reporter: Vladimir Strugatsky
>
> These are the generated FROM and WHERE clauses:
> from IMPACTS this_ left outer join IMPACT_DEGREE_TYPES alias_1x1_ on this_.ID_IMPACT_DEGREE_TYPES=alias_1x1_.ID_IMPACT_DEGREE_TYPES where lower(alias_1x1_.IMPACT_DEGREE_TYPE)<>?
> And here is the value of the IMPACT_DEGREE_TYPE as generated by Hibernate:
> [2007-08-13 19:13:31,039]: [DEBUG] org.hibernate.type.StringType - binding '[0 - no impact]' to parameter: 1
> The value that we pass to Restrictions.ne() is '0 - No Impact' . Hibernate correctly converts the value to the lower case, because we use ignoreCase(). But it also encloses the value in square brackets, which, of course, breaks the query.

-- 
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