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).
|