开发者

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) 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜