是什么影响 NHibernate 使用外连接而不是内连接?

发布于 2024-11-30 16:42:14 字数 269 浏览 6 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

粉红×色少女 2024-12-07 16:42:14

如果 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文