-->
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: EAGER loading
PostPosted: Fri Jun 10, 2005 10:18 am 
Newbie

Joined: Fri Jun 10, 2005 9:32 am
Posts: 5
Hibernate version:3.0

All,
Is it possible to eagerly load associations of an object.
Let me explain in detail:
EntityA has a set of EntityB
EntityB again has a set of EntityC objects.

I am loading an(one) EntityA object using Session.load(EntityA.class, new Long(1L)).

When EntityA is loaded, i use filter (<filter-def>) & eager loading ( i.e lazy=false ) to load a selected/filtered EntityB associated to EntityA.

Now i want to load the EntityC objects associated to EntityB object being loaded. I don't want to use eager loading again ( i.e lazy=false ) , to load EntityC objects. Only if some of my conditions are satisfied then i have to eagerly load EntityC objects, else iam happy to load them lazily.

Is there a way to specify programatically to eagerly load associations instead of specifying in the mapping file.

This is something similar to Criteria.setFetchMode(FetchMode.JOIN).


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.