I have a class/table named "Comment"
<class name="Comment">
<id name="Id">
<generator class="guid"/>
</id>
<property name="ReferenceId" index="Comment_ReferenceId_Index" />
<property name="Contents" length="1024" />
And I need to create a bag of comments on several other classes like Contract
<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>
Or Application:
<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>
But this mapping give me only one foreign key, how can i create the collection to have comments on several classes?