-->
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: Need to load for than one collection eagerly
PostPosted: Sat Sep 11, 2004 6:01 am 
Beginner
Beginner

Joined: Mon Dec 08, 2003 12:15 am
Posts: 47
My object model consists of a Step object which contains a collection of sub-steps and a collection of assistance.

Step and sub-steps have a one to many relationship.

Step and client assistance have a many to many relationship.

In my application a user always gets the sub-steps, but he/she might also request the client assistance. So in my query I am eagerly fetching the sub-steps since I want all the steps -based on some other criteria - regardless of whether they have a parent step or not. But since hibernate restricts the number of eager fetches to one, I'd like to know how you can go about loading the client assistance collection. At the present time, I iterate through each step and then call:

step.getClientAssistance().iterator();

But obviously this is not the most optimized way of doing it because if I have 100 steps, then there will be 100 queries to get the assistance out of the assistance table

I am using hibernate version 2.1

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.