Hi

I am using NHibernateUtil.Initialize in the following manner to
efficiently eager load an object graph upto 3 levels deep using
batching on the collections.

entity is loaded via an intial criteria query.

NHibernateUtil.Initialize(entity.Collection1);
NHibernateUtil.Initialize(entity.Collection2);

NHibernateUtil.Initialize(entity.Contacts);
foreach (var c in entity.Contacts)
{
    NHibernateUtil.Initialize(c.CommunicationMethods);
    NHibernateUtil.Initialize(c.Roles);
}

In the mapping for CommunicationMethod i have a many-to-one fetch join
association to a CommunicationMethodType object "Type".  This contains
a column that I want to sort on when obtaining CommunicationMethods.

I have tried the following on the CommunicationMethods bag mapping
without joy:
<bag batch-size="50" inverse="true" name="CommunicationMethods"
mutable="true" order-by="Type.Sequence">

Any ideas how i can retain batching and sort this collection of
grandchildren?

Thanks
Kevin

-- 
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