-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Extra inner join appended to outer join query
PostPosted: Fri Sep 12, 2014 8:44 am 
Newbie

Joined: Mon Jun 02, 2014 12:45 pm
Posts: 7
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.