see detailed description of my N+1 queries when performing a
criteria.list with a join to another joined entity.
I'm quite clueless by now, perhaps someone will have an idea.
these are the objects: (properly renamed :) )
Order -> Pot <-> Cover
order is many-to-one associated to Pot. (so different orders can point
to the same Pot).
Order table has a "PotId" field (with keys from Pot table).
Pot is one-to-one, bidirectionaly associated to Cover - one side is
"one-to-one", the other is "many-to-one".
Cover table has a "PotId" field (with keys from Pot table).
The troubles begin when I perform:
session.CreateCriteria(typeof (Order)).CreateAlias("pot", "pot",
JoinType.LeftOuterJoin).List();
what I get is a single query fetching orders+pots, and then N queries
fetching cover (by cover.PotId).
tried tweaking this way and the other but to no avail.
I thought this may be linked to the issue of "no lazy loading for one-
to-one associations",
but I can't get around it.
any ideas? will be happy to supply more information.
--
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.