I opened a bug report on this ( https://hibernate.atlassian.net/browse/HHH-9394 )
Given this HQL:
Code:
select p, p.department from Person p left outer join p.department
Prior to 3.5.0 the generated SQL looks like:
Code:
select ...
from
PERSON person0_
left outer join DEPT department1_ on person0_.DEPARTMENT_ID=department1_.ID
From 3.5.0 on the generated SQL looks like:
Code:
from
PERSON person0_
left outer join DEPT department1_ on person0_.DEPARTMENT_ID=department1_.ID
inner join DEPT department2_ on person0_.DEPARTMENT_ID=department2_.ID
The extra inner join is removing from the results PERSONs who adon't have a DEPARTMENT.
I'm curious how this has been this way since 3.5.0 . Is there a way to do an outer join in HQL without getting the additional inner join? Am I doing something wrong, or is my understanding on what the HQL outer join should be doing incorrect?
I found this in hibernate-core 4.3.6, but can reproduce all the way back to 3.5.0.
Thanks for any help.
Robin