我有一个名为类/表“注释”Nhibernate:如何为同一班级的孩子创建两个班级的<bag>?
<class name="Comment">
<id name="Id">
<generator class="guid"/>
</id>
<property name="ReferenceId" index="Comment_ReferenceId_Index" />
<property name="Contents" length="1024" />
,我需要在其他几类创建的评论的袋子像合同
<class name="Contract">
<id name="Id">
<generator class="guid"/>
</id>
<property name="Status"/>
<bag name="Comments">
<key column="ReferenceId" />
<one-to-many class="Comment" />
</bag>
或应用程序:
<class name="Application">
<id name="Id">
<generator class="guid"/>
</id>
<property name="Status" />
<bag name="Comments">
<key column="ReferenceId" />
<one-to-many class="Comment" />
</bag>
但是这个映射只给我一个外键,我如何创建集合以对几个类进行评论?
不知道我是否理解。 ReferenceId是哪个表的外键? – 2011-12-14 20:05:48