Hibernate version:
3.0 Beta 2
The entity-name attribute has been working quite well so far to enable a refactoring of my domain model to consolidate several nearly identical classes that were mapped to different tables down to one class, but now I've hit a snag.
I'm trying to map a child entity with a natural primary key using the composite-id element. Its parent entity is one of the refactored classes I've created using the entity-name attribute to map it to multiple tables. One of the properties that makes up the composite id of the child is also the foreign key that relates it to the parent entity.
I had hoped to use a mapping such as:
Code:
<composite-id>
<key-many-to-one name="parent"
column="parentId"
entity-name="parentEntity1"/>
<key-property name="lineNum"
column="Line_Number"/>
</composite-id>
but entity-name is not a valid attribute of the <key-many-to-one> element according to the DTD.
Is this something that could be added, or is there an alternate way I should be going about the mapping?
Thanks,
Jeremy