[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)

2009-08-10 Thread Fabio Maulo
which is the question ? 2009/8/10 mhnyborg mhnyb...@gmail.com I just want to here if NH 2.1 has some new features that makes selection from 3 levels possible. for example I want to load all customers with all orders and order lines. I can get the Customers and orders using

[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)

2009-08-10 Thread mhnyborg
The question is: can I distinct load this object graph: Baselines- HasMany-BaselineMilestones-HasMany-BaselineMilestonePrevious var baselines = session.CreateQuery( from Baseline b left join fetch b.BaselineMilestones bm left join fetch bm.BaselineMilestonePrevious )

[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)

2009-08-10 Thread Dario Quintana
If your question is how to do it, here you have an example: *select o from Order o join fetch o.Lines li join fetch li.Article where o.Id = :Id* OR * s.CreateCriteria(typeof (Order)) .SetFetchMode(Lines, FetchMode.Join) .SetFetchMode(Lines.Article,

[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)

2009-08-10 Thread Fabio Maulo
but... you should understand the difference between set and bag ;) P.S. bag es una bolsa de gatos. 2009/8/10 Dario Quintana conta...@darioquintana.com.ar If your question is how to do it, here you have an example: *select o from Order o join fetch o.Lines li join fetch li.Article where o.Id

[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)

2009-08-10 Thread Martin Nyborg
Thanks for reply. But I have 3 collection var baselines = session.CreateQuery( from Baseline b left join fetch b.BaselineMilestones bm left join fetch bm.BaselineMilestonePrevious) .SetResultTransformer (Transformers.DistinctRootEntity)