[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5886) Inequality operator (<>) on component/composite-id uses AND instead of OR between atomic fields comparison

Emanuele Gesuato (JIRA) noreply at atlassian.com
Thu Mar 3 03:39:09 EST 2011


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

Emanuele Gesuato commented on HHH-5886:
---------------------------------------

We have tried 3.6.1 but the problem seem unresolved. Added HHH-5946 with a full example.

> Inequality operator (<>) on component/composite-id uses AND instead of OR between atomic fields comparison
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5886
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5886
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.2.7
>         Environment: 3.2.7GA, jetty, H2/oracle 11g/DB2 v9
>            Reporter: Paizo
>
> As described here: [https://forum.hibernate.org/viewtopic.php?f=1&t=1009229&start=0]
> given this mapping snippet:
> {quote}
>    <class name="d.p.entityIDMUnit.lim.bl.pom.impl.PPKone" table="PPKone">
>       <composite-id>
>          <key-property name="i" type="IntegerType">
>             <column name="c_i_5b145" precision="19" scale="0"/>
>          </key-property>
>          <key-property name="j" type="IntegerType">
>             <column name="c_j_4534d" precision="19" scale="0"/>
>          </key-property>
>       </composite-id>
> ...
> {quote}
> and the following HQL:
> from d.p.entityIDMUnit.lim.bl.pom.impl.PPKone p where (( ( p <> p ) and ( p.i = 1 ) ))
> The SQL where statement looks:
> where
>    *ppkone0_.c_i_5b145<>ppkone0_.c_i_5b145
>    {color:red} and {color}  ppkone0_.c_j_4534d<>ppkone0_.c_j_4534d*
>    and ppkone0_.c_i_5b145=1
> when it should be: 
>    *{color:red}({color}ppkone0_.c_i_5b145<>ppkone0_.c_i_5b145
>    {color:red} OR {color} ppkone0_.c_j_4534d<>ppkone0_.c_j_4534d{color:red}){color}*
>    or ppkone0_.c_i_5b145=1
> A component/composite-id is different from another one if at least ONE of its fields is different, not only when all the fields are different

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