I believe that unless you disable lazy loading in the mapping (which isn't the best of ideas) then a Get will not "get" the object tree from the database in one hit, unless you edit the collection mapping to do this, e.g. fetch="join" etc. See http://nhforge.org/blogs/nhibernate/archive/2009/04/13/nhibernate-mapping-lt-set-gt.aspx. You can do something similar to single objects. The downside is that this is application wide, ie. it can't be fine-tuned at runtime.
You can also do this as a query, in conunction with LEFT JOIN FETCH (if using HQL). I think you may be able to do this with Future Queries, but I've not used them yet. It can be seen as a little messy to have to do this, so I wrap these sort of calls in a special Get function in my repository (e.g. GetPersonWithAddresses etc.). -- 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.
