Are you sure you want to do that? It will be a Cartesian product. if you want to save a few trips to the database, you may want to use futures.
I think with get() you need to set the default behavior in the mapping. you would use Linq to NHibernate and use the fetch feature: session.Query<Blog>.Fecth(x=>x.Author).Fetch(x=>x.Comments).SingleOrDefault(x=> x.id == id); On Mon, Jan 2, 2012 at 3:15 PM, Shatl <[email protected]> wrote: > Hi, > > Is it possible to force eager loading of related entities with Load() or > Get()? > > E.q. I have following hierarchy: > class Blog { > public User Author { get;set;} > public IList<Comment> Comments { get;set;} > } > > class Comment { > public User Owner { get;set} > } > > Is there a way to load Blog, Blog.Author, Blog.Comments and > Blog.Comments.Owner in one DB trip? > > Thanks > > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/nhusers/-/3864-kqlIhgJ. > 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. > -- 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.
