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
")
                                                .SetResultTransformer
(Transformers.DistinctRootEntity)
                                                .List<Baseline>();

Assert.IsNotNull(baselines,"baselines is not null"); WORKS
Assert.AreEqual(39, baselines.Count(), "Baseline.Count() == 39");
WORKS
Assert.AreEqual(baselines[0].BaselineMilestones.Count, 56); TO MANY
RETURNED

The problem is that I need a DistinctRootEntity logic to be applied to
BaselineMilestones

On Aug 10, 11:08 pm, Fabio Maulo <[email protected]> wrote:
> which is the question ?
>
> 2009/8/10 mhnyborg <[email protected]>
>
>
>
>
>
> > 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
> > Transformers.DistinctRootEntity but that's only fixes the customer
> > collection I get to many orders.
>
> > The problem is better explained here:
>
> >http://stackoverflow.com/questions/332703/nhibernate-eager-fetching-o...
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to