Left Join on Many-to-One Mapping
I have a reference to call that may or may not be there. When I add the nullable option it still doing Inner Join when I want an Left Join (show the left even if the right is null). Is this开发者_Python百科 possible in the NH map?
References(x => x.DefaultCategory, "CATEGORY_ID")
.Nullable();
The join type isn't specified in the mapping, but in the query.
IN HQL, use left join syntax as with SQL.
With Criteria, use:
.CreateAlias("categories", "c", JoinType.LeftOuterJoin)
精彩评论