-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Bidirectional references using join table and union-subclass
PostPosted: Mon Jun 09, 2008 10:31 am 
Newbie

Joined: Mon Jun 09, 2008 7:17 am
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.