Unfortunately, using JoinAlias:
Parent parentAlias = null;
Child childAlias = null;
var r = session.QueryOver<Parent>(() => parentAlias)
.JoinAlias(() => parentAlias.Children, () => childAlias)
.OrderBy(x => parentAlias.Name).Asc
.ThenBy(x => childAlias.Name).Asc
.List();
gives redundant sql:
SELECT
this_.ParentId as ParentId1_2_,
this_.Name as Name1_2_,
this_.Value as Value1_2_,
childalias1_.ChildId as ChildId0_0_,
childalias1_.ParentId as ParentId0_0_,
childalias1_.Name as Name0_0_,
childalias1_.Value as Value0_0_,
parent4_.ParentId as ParentId1_1_,
parent4_.Name as Name1_1_,
parent4_.Value as Value1_1_
FROM
Parent this_
inner join
Child childalias1_
on this_.ParentId=childalias1_.ParentId
left outer join
Parent parent4_
on childalias1_.ParentId=parent4_.ParentId
ORDER BY
this_.Name asc,
childalias1_.Name asc
--
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.