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)
                                                .List<Baseline>();

I need all the baseline

each baseline has a collection of BaselineMilestones
and each BaselineMilestones has a collection of
BaselineMilestonePrevious

In our example:
 all orders with all orderlines and Article need to be a collection on
orderlines, not a single class

hope that helps to explain my problem.



On Aug 10, 11:56 pm, Dario Quintana <conta...@darioquintana.com.ar>
wrote:
> 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", FetchMode.Join)
>                     .Add(Restrictions.Eq("Id",
> orderId)).UniqueResult<Order>();*
>
> The 3th level is Article.
>
>
>
> On Mon, Aug 10, 2009 at 5:21 PM, mhnyborg <mhnyb...@gmail.com> wrote:
>
> > 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...
>
> --
> Dario Quintanahttp://darioquintana.com.ar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to