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: is the bidirectional one-to-one mapping right?
PostPosted: Wed Apr 01, 2009 6:24 am 
Newbie

Joined: Wed Apr 01, 2009 6:11 am
Posts: 1

The Link has two Ports, one is source port and another is destination port. and one port only can be used by one Link.

so, I want to set two one-to-one mapping attributes in LINK.hbm.xml, but I don't kown how to set the one-to-one mapping attributes in Port.hbm.xml.


The following is Link.hbm.xml
<hibernate-mapping>
<class
name="TransportLink"
table="TRANSPORTLINK" >

<many-to-one
name="APort"
class="Port"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="APORTID"
not-null="true"
unique="true"
/>
<many-to-one
name="ZPort"
class="Port"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="ZPORTID"
not-null="true"
unique="true"
/>
</class>
</hibernate-mapping>

and how to write the port.hbm.xml to realize bidirectional one-to-one mapping?

Thanks very much!


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.