I have a query which is something like this:
Session.CreateSQLQuery(
@"SELECT f.*, b.*, z.* FROM Foo f
LEFT OUTER JOIN Bar b ON b.Id = f.BarId
LEFT OUTER JOIN Zar z ON z.Id = b.ZarId"
)
.AddEntity("f", typeof(Foo))
.AddJoin("b", "f.BarId")
.AddJoin("z", "f.ZarId")
.List<Foo>();
The problem is that I am still getting hundreds of SELECT requests
made to the Zar table, even though I have specified that Zar should be
joined.
As far as I am aware the only relationship is Foo->Bar->Zar, i.e. the
reference to Zar is not occurring anywhere else.
Is my understanding of AddJoin correct?
What could be going wrong?
--
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.