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

Sebastien Cesbron (JIRA) noreply at atlassian.com
Wed Oct 18 03:07:25 EDT 2006


incorrect hql query on one-to-one with property-ref 
----------------------------------------------------

         Key: HHH-2158
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2158
     Project: Hibernate3
        Type: Bug

  Components: core  
    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