[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()

Tsuyoshi Goto (JIRA) noreply at atlassian.com
Tue Aug 14 15:41:13 EDT 2007


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

Tsuyoshi Goto commented on HHH-2779:
------------------------------------

Dear Diego,

Thank you for your prompt response.
I am a developer working for Vladimir.

Embarrassingly I need to admit it was my Bug in my codes that uses CriteriaAPI in our AdvancedSearch function which I am responsible for.

I was passing Collection 'values' instead of a 'value'.
And I believe Collection.toString caused this 'square brackets'!
How embarrassing...


So please close this issue if you have a permission.
I am very appreciating the grate capacity of CriteriaAPI.

Best Regards,
   Tsuyoshi
8.14.2007.







> 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