Is paging a child collection automatically possible with
nhibernate? ...
I have a parent child relationship (don't we all?) such as Customer ->
Orders (10,000 or more records/entities) and I want to be able to
enumerate through Orders from Customer without having all 10,000
orders coming back. I should be able to do the following and allow
nhibernate to page it accordingly (Note: This is not my actual
scenario, just using it to make the point obvious).
// Let the enumerator handle the paging?
foreach (Order order in customer.Orders)
{
}
The only thing I've managed to find that may help is the batch-size
fetching attribute on <bag> and <set> elements in the hbm files, but
this seems to only help in Select N+1 scenarios, not in what I'm
describing.
And the only work around architecturally is to make Orders into an
aggregate root of it's own and then use IQuery to setup paging. To me
this seems rather ugly as it breaks the domain hierarchy up into an
unnatural object model.
Thanks,
Stephen
--
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.