-->
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: left join doesn't work in nested query
PostPosted: Wed Jan 31, 2007 2:48 pm 
Newbie

Joined: Wed Jan 31, 2007 2:37 pm
Posts: 1
I have using hibernate 3.

Problem is left join works if I have a simple query, but not in a nested query.

If I have a nested query:
select ... where i.id in(Select ... From Parent p left join p.children as c ....). In the debug log, the actual JDBC query is just ... From Parent p, Children c, there is no left join.

But if I try the simple query as following, it works:

select count(*) from Parent p left join p.children as c where ...,
then in the debug log, I see the actual query is Parent p left outer join Children c on p.id = children.parent_id. This is what I want.

I tried to set max_fetch_depth to 3, tried to setSession criteria for that parent, children relationship to FetchMode.JOIN.

I don't know what else I can do. Please help. Thanks!!!!


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.