Either by using three different selects,
[get type3 where xxx]
[get type2 where xxx]
[get type1 where xxx]
...preferable batching these queries using MultiCriteria/Query
...or...
Getting a wider set back, using joins.
SetFetchMode("Reference", FetchMode.Join), Criteria
join fetch, HQL
/Roger
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Morten Haug
Sent: den 1 april 2009 08:42
To: nhusers
Subject: [nhusers] How to eager load a object hierarchy in one batch
Hi, lets say I have a structure like this:
Type1
|--Type2
| |--Type3
| |--Type3
|--Type2
| |--Type3
| |--Type3
How could I best fetch this tree (no lazy loading)? "Out of the box"
it looks like it for each of the Type2's, it makes a select for its
collection of Type3's. What I'd like is to batch it up into one select
for all Type3's, and map them correctly into their respective Type2
parent.
Best regards,
Morten Haug
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---