Hi,
I have a problem with selecting a deep object graph without Select N+1
or cartesian product.
The model contains the classes Continent, Country and City. Each
Continent contains a list of Country, and each Country contains a list
of City, with bidirectionnal associations(Country has a Continent
property and City has a Country property).
I want to load a list of all the Continents, with all the countries
and cities. I know it is a lot of objects(around 2500 in total), but I
don't have any other choice, and it was previously done with ADO.NET
with acceptable performance.
I started by doing it the wrong way and I got either the Select N+1
problem or the Cartesian product problem, and it was not fast enough.
So I tried to do the following :
IMultiCriteria vMC = CurrentSession.CreateMultiCriteria();
vMC.Add<City>("city", CurrentSession.CreateCriteria<City>
());
vMC.Add<Country>("country",
CurrentSession.CreateCriteria<Pays>());
vMC.Add<Continent>("continent",
CurrentSession.CreateCriteria<Continent>());
which gives good performance, but doesn't work because the relations
are not initialized.
I have read this :
http://ayende.com/Blog/archive/2007/06/20/Efficently-loading-deep-object-graphs.aspx
but I'm not sure it applies in my case
Any idea how I can do this ?
Thanks,
Stephane Farges.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---