是什么影响 NHibernate 使用外连接而不是内连接?
我在 NHibernate 项目中有多个一对多映射,它们被配置为使用 Sets
。
如果不进行项目,并且将 max_fetch_depth
设置为 2,NHibernate 似乎总是使用外连接而不是内连接。
这是有原因的吗?映射结构相当于:
Category
+- Document.Category
+- Document.User
只是一个简单的一对多设置。
I have several one-to-many mappings in an NHibernate project that are configured to use Sets
.
Without doing projects, and with max_fetch_depth
set to 2, NHibernate appears to always use outer joins instead of inner joins.
Is there a reason for this? The mapping structure is the equivalent of:
Category
+- Document.Category
+- Document.User
Just a plain one-to-many setup.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 Nhibernate 进行内部联接,则意味着不会获取没有文档的类别。
这就是为什么 nHibernate 总是使用外连接,除非您特别查询。
if Nhibernate did inner joins, that means that Categorys that have no Documents would not be fetched.
This is why nHibernate always uses outer joins unless you specifically query otherwise.