Not an Issue
Details
Details
Assignee
Richard Brown
Richard BrownReporter
Massimiliano Alberti
Massimiliano AlbertiComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created December 9, 2011 at 4:47 PM
Updated December 20, 2011 at 8:02 PM
Resolved December 20, 2011 at 8:02 PM
The LINQ provider has a ThenFetch method to eagerly load a table referenced by another table referenced by another table (so with A.B.C, B can be eagerly loaded through Fetch, C can be eagerly loaded through ThenFetch). The QueryOver provider doesn't have anything similar (at least if B is a "collection". Haven't tested with B being 0-1). You can go around the problem using something like:
B aliasB = null;
C aliasC = null;
query = query.JoinAlias(p => p.B, () => aliasB, JoinType.LeftOuterJoin)
.JoinAlias(() => B.C, () => aliasC, JoinType.LeftOuterJoin);
but the syntax is more complex and I'm not even sure it's equivalent (taken from http://stackoverflow.com/questions/4801235/nhibernate-3-alternatives-to-thenfetch-in-queryover )