标签: java hibernate
我有两个类和关联表。它们具有entity_id和entity_type的列。这些与其他地方的鉴别器一起映射,但我希望在这两列上以多对一关系将一个实体加入另一个实体。
那多对一的样子会是什么样的?我有
<many-to-one name="otherTable" class="com.project.OtherTable" column="entity_id,entity_type" />