【发布时间】:2017-02-13 17:29:47
【问题描述】:
我正在使用 NHibernate 和 QueryOver。我的聚合有一个聚合根,名为 Parent 和两种子实体。我有 Child 实体,它们是我的聚合的一部分,还有 QUChild 实体不是我的聚合的一部分,它们仅用于 QueryOver 中的 JOIN 子句。
如何区分映射文件中的两个子实体?
<class name="Parent" table="Parent" schema="dbo">
<bag name="Childs" inverse="true" cascade="all-delete-orphan" />
<key>
</key>
<one-to-many class="Child" />
</bag>
<bag name="QUChilds" /> <!-- which attribute must be set to do nothing? -->
<key>
</key>
<one-to-many class="QUChild" />
</bag>
</class>
【问题讨论】:
标签: nhibernate nhibernate-mapping queryover