You probably want this: http://ayende.com/Blog/archive/2007/06/20/Efficently-loading-deep-object-graphs.aspx
-------- Original Message -------- Subject: [AR] Detached Criteria - Eager Loading From: Cosmo <[email protected]> To: Castle Project Users <[email protected]> Date: 6/2/2009 8:32 AM > I have a class with two many-to-many associations. After reading the > docs I realised that I'm allowed to get only one collection. So how is > it possible to get all collections with eager loading? > > So far... > > DetachedCriteria dc = DetachedCriteria.For<File>(); > dc.SetResultTransformer(new DistinctRootEntityResultTransformer()); > dc.SetFetchMode("ComplaintCause", FetchMode.Eager); > dc.SetFetchMode("InsuranceType", FetchMode.Eager); > dc.SetFetchMode("Applicants", FetchMode.Eager); // MANY-TO-MANY > > Now I would like to get another collection: > dc.SetFetchMode("Insurers", FetchMode.Eager); // MANY-TO-MANY > > But this gives me strange results. Is it possible to use a MultiQuery, > or is there even a better way to go? > > Thanks for your help in advance. > Cosmo > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
