-->
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.  [ 2 posts ] 
Author Message
 Post subject: bidirectional association using joined table
PostPosted: Sat Aug 12, 2006 3:24 pm 
Newbie

Joined: Thu Mar 30, 2006 2:54 am
Posts: 11
Hi, it is possible to map bidirectional association usin joined table when the source class is mapped as a joined subclass? The schema dtd3.0 doesn't support element <join> within element <joined-subclass>

Ex:
<joined-subclass name="Proprietor" table="T_PROPRIETOR">
<key column="ID"/>
....
<set name="facilities" table="R_PROPRIETOR_FACILITY" cascade="all,delete-orphan">
<key column="ID_PROPRIETOR"/>
<many-to-many column="ID_FACILITY" class="Facility" unique="true"/>
</set>
</joined-subclass>

<joined-subclass name="Facility" table="T_FACILITY" abstract="true">
<key column="ID"/>
<!-- HERE I NEED USE JOIN element -->
</joined-subclass>
</class>

thanks for any help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 13, 2006 11:35 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The <join> element does not provide an association. It is closer to a view. You cannot use join within joined-subclass, but you can use many-to-one assocuations and collection elements (map, set, list, array, bag, etc.), and those are what you need to make bidirectional associations.

Read chapters 6 and 7 of the ref docs. Note the lack of the <join> tag in those two chapters.

_________________
Code tags are your friend. Know them and use them.


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

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.