Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 3.3 版的 NHibernate 更改日志中读到,您现在可以延迟加载一对一的关联,这在以前是不可能的,我尝试在我的关联上设置延迟,但它仍然会变得渴望加载,映射将如何对于延迟加载的一对一关联?我正在使用fluentNhibernate。
由于只有在保证有可用目标的情况下才能生成代理(因为 NHibernate 在加载时不能用 null 替换代理),所以 NHibernate 需要知道您的一对一关联在数据库中受到约束。这是通过标签constrained上的属性完成的。<one-to-one>
constrained
<one-to-one>