joined-sbuclass + oneToMany eager lead to incorrect SQL
-------------------------------------------------------
Key: HHH-2278
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2278
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1
Environment: H 3.2.1
Reporter: Anthony Patricio
Priority: Minor
Attachments: bug.zip
Model:
Injury *--1 Person
Suspect extends Person (joined subclass)
Suspect 1--* Case (eager with fetch=join)
Part of the SQL generated when executing "from Injury":
from Person person0_
left outer join Suspect person0_1_
on person0_.id=person0_1_.PERSON_ID
left outer join Case cases1_
on person0_.id=cases1_.PERSON_ID
where person0_.id=?
should be:
from Person person0_
left outer join Suspect person0_1_
on person0_.id=person0_1_.PERSON_ID
left outer join Case cases1_
on person0_1_.id=cases1_.PERSON_ID
where person0_.id=?
A simple workaround is to define
Suspect 1--* Case (eager with fetch=select, instead og join)
I've attached a testcase (EJB3 + hbm)
--
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