且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

nHibernate 2.0 - 映射复合 ID * 和 * 多对一关系导致“无效索引"错误

更新时间:2023-01-14 23:42:02

凯,这就是答案.几乎没有关于此的文档:

Kay, here's the answer. Little-to-no documentation on this:

<composite-id name="PersonTagKey" class="PersonTagKey"> 
  <key-many-to-one name="Person" column="PersonId" lazy="proxy" class="Person">
  <key-many-to-one name="Tag" column="TagId" lazy="proxy" class="Tag"/>
</composite-id>

这将允许您创建一个由多对一关系的逆组成的复合 ID.

This will allow you to create a composite-id made up of the inverse of a many-to-one relationship.

良好的狩猎...