[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2158) incorrect hql query on one-to-one with property-ref

Graeme Rocher (JIRA) noreply at atlassian.com
Mon Jun 22 09:05:34 EDT 2009


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

Graeme Rocher commented on HHH-2158:
------------------------------------

Causing http://jira.codehaus.org/browse/GRAILS-4601 in Grails

> incorrect hql query on one-to-one with property-ref 
> ----------------------------------------------------
>
>                 Key: HHH-2158
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2158
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.0.ga
>         Environment: hibernate 3.2.0.ga with firebird 1.5.3 and jaybird 1.5.5 driver on windows XP
>            Reporter: Sebastien Cesbron
>         Attachments: testhib.zip
>
>
> I have a one-to-one relationship with property-ref between Master and Slave2.
> I want to find all Master instances that have a null Slave2 instance associated.
> To do so my query is
> select master from Master master where master.slave2 is null
> The sql generated is
> select master0_.oid as oid0_, master0_.libelle as libelle0_ from Master master0_ where master0_.oid is null
> which seems incorrect. It checks here Master instances with null id (config files are listed below).
> If I do my query like this
> select master from Master master where master.slave2.oid is null
> the generated sql is ok :
> select master0_.oid as oid0_, master0_.libelle as libelle0_ from Master master0_, Slave2 slave2x1_ where master0_.oid=slave2x1_.myMaster and (slave2x1_.oid is null)
> I have attached a small eclipse project that reproduces the problem
> This problem may-be related to the one I have submitted as issue HHH-1849

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