[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2158?page=c...
]
Vasyl Zhabko commented on HHH-2158:
-----------------------------------
Is anybody going to fix that? We having this issue whenever we are using one-to-one
ralationship and it is optional on one side. There is no way to get it perform well with
Criteria API or HQL. Only workaround is to map not required side as a collection (Set,
etc) and in class wrap it up in single property that will assume collection will always
consist of one element or nothing.
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
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira