you do not need to do it. hibernate does it for you out of the box. - if you transfer your object over the wire ( serialize / deserialize ) - collection will be fetched beforehand. Though you have to be carefull with object reachability - you may fetch far more than expected....
Konstantin,
as far as I can see the default behaviour of hibernate is, as you said, to fetch an object's collections when it is loaded. To avoid fetching too many objects hibernate recommends to use lazy loading. With lazy loading you have to initialize an object's collection before you can access it.
However you need a hibernate session to initialize collections but in a layered architecture you typically can not (and do not want to) retrieve a hibernate session in every layer. If this is the case there is no choice but explicitly asking the "hibernated layer" to initialize the collection, right? Is there some recommended strategy / pattern / anything else?
Regards,
Roger
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
