[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1575) Expression.in on component object gives parameters til SQL in wrong order

Chris Wilson (JIRA) noreply at atlassian.com
Fri Dec 18 03:02:34 EST 2009


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

Chris Wilson commented on HHH-1575:
-----------------------------------

If anyone needs a workaround for this bug in Hibernate 3.3.2, you can download our fixed copy of the InExpression class here:

http://rita.wfplogistics.org/trac/browser/rita/src/org/wfp/rita/db/FixedInExpression.java

and then replace this code:

{code}
criteria.add(Restriction.in("id", ids));
{code}

with:

{code}
criteria.add(new FixedInExpression("id", ids));
{code}

> Expression.in on component object gives parameters til SQL in wrong order
> -------------------------------------------------------------------------
>
>                 Key: HHH-1575
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1575
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.1.2
>         Environment: Oracle 9i, org.hibernate.criterion.InExpression
>            Reporter: Thierry Hermann
>             Fix For: 3.5
>
>         Attachments: HibernateMultiColumnPrimaryKeyCriteriaTest.java
>
>
> The InExpression produces a statement like [where (key, station) in ((?,?),(?,?)...)] indeed.
> but the parameter binding is wrong.
> In fact if you look in org.hibernate.criterion.InExpression, getTypedValues() method (line: 53-54) both for loop should be inverted:
> for ( int i=0; i<types.length; i++ )  
>    for ( int j=0; j<values.length; j++ )
> should become:
> for ( int j=0; j<values.length; j++ )
>    for ( int i=0; i<types.length; i++ )  

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