Hi,
I want to map a bidirectional one to many association on a join table.
The problem is that the classes are union-subclasses, i.e. I want to use the table per concrete class mapping strategy.
I thought the mapping has to be as follows (according to chapter 7.5.1 of the Hibernate documentation):
<union-subclass name="Element" table="Element">
<set name="events"
table="ElementEvent">
<key column="elementId"/>
<many-to-many column="eventId"
unique="true"
class="Event"/>
</set>
</union-subclass>
<union-subclass name="Event"
table="Event">
<join table="ElementEvent"
inverse="true"
optional="true">
<key column="eventId"/>
<many-to-one name="Element"
column="elementId"
not-null="true"/>
</join>
</union-subclass>
The problem is that <join> does not seem to be allowed within union-subclass!
How can I make a bidirectional many-to-one reference here?
Thanks for your support.
Best regards,
Daniel
|