-->
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: Limit on left join fetch ( Hibernate2 vs Hiberante3) HQL
PostPosted: Tue Mar 14, 2006 3:49 pm 
Newbie

Joined: Mon Nov 21, 2005 5:21 pm
Posts: 6
It is my understanding that there used to be one collection(per level) eager fetch restriction in Hibernate2 and that has been removed in Hibernate3.

Does that mean Hibernate3 still defaults to 1 collection fetch for backward compatibility? If that is, Can anyone point me the property to set the appropriate values?

Currently, I am trying to eager fetch 2 different collections from an object in order to avoid n+1 select issue with Hibernate. I have a class Company that has 1 to many relationship with employee and partner objects.
In my HQL I have defined " from Company c left join fetch c.partner left join fetch c.employee where...."
When I turn on show_sql, I am still seeing the select query run n times for the the retrieval of employee. If i change the HQL so that employee is before partner, I now see query for getting partners executed n times?

Thanks in advance

Thapa


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.