开发者

Left Join on Many-to-One Mapping

开发者 https://www.devze.com 2022-12-25 12:08 出处:网络
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

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

精彩评论

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