-->
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.  [ 3 posts ] 
Author Message
 Post subject: left outer join inside a subquery : a bug ?
PostPosted: Thu Sep 08, 2005 5:50 am 
Newbie

Joined: Thu Sep 08, 2005 5:19 am
Posts: 2
Hibernate version: 3.0.5 and 3.1beta2



Its seems that a left outer join query executed inside a subquery does not work.

In fact, the sql query generated by hibernate for this example :

" select o1 from table1 as o1 where o1.id in ( select o.id from table1 as o left outer join o.comps as comp where .... ) "

will be :

" select o1 from table1 as o1 where o1.id in ( select o.id from table1 o, table2 comp where .... ) "

instead of

" select o1 from table1 as o1 where o1.id in ( select o.id from table1 o left outer join table2 comp on o.id = comp.id where .... ) ".

I hope i am quite clear. To be short, " from table1 left outer join table2" is interpreted as "from table1, table2".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 7:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
"theta-style" joins are used inside subqueries


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 7:41 am 
Newbie

Joined: Thu Sep 08, 2005 5:19 am
Posts: 2
Does this explains why I do not get the same result when the same request is executed inside a subquery or not ?
Does this mean that we can't use a "left outer join" inside a subquery ?

I would like to add that when I execute the request inside a subquery, no join is performed at all, I mean that there is no "where o.id = comp.id" of "theta-style" join that replaces the join of "ANSI-style" join.


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

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.