NHibernate:引用需要内连接而不是左连接
当我使用引用时,如何将映射的默认联接类型更改为内联接而不是左外联接?
例如:
public class SomeClassMap : ClassMap<SomeClass>
{
public SomeClassMap()
{
Id(x => Id);
References(x => x.Account);
}
}
这通常是这样的...
FROM SomeClass SC
LEFT OUTER JOIN Account A
ON SC.Id = A.Id
我希望这是一个内部连接而不是左外部连接。有什么想法吗?
How can I change the default join type to be an inner join instead of a left outer join for mappings when I use References?
For Example:
public class SomeClassMap : ClassMap<SomeClass>
{
public SomeClassMap()
{
Id(x => Id);
References(x => x.Account);
}
}
this usually turns out to be something like this...
FROM SomeClass SC
LEFT OUTER JOIN Account A
ON SC.Id = A.Id
I'd like to have this be an inner join instead of a left outer join. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类似的问题在这里:
Nhibernate 中的内部或右外部连接以及多对多集合上的 Fluent Nhibernate
我假设这也适用于一对多关系。如果这不再成立,请有人插话。
Similar question here:
Inner or Right Outer Join in Nhibernate and Fluent Nhibernate on Many to Many collection
I'm assuming this also applies to one to many relationships. Someone please chime in if this does not hold true anymore.