-->
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: unidirectional many-to-one using join table
PostPosted: Thu Jan 28, 2010 2:53 pm 
Newbie

Joined: Tue Jul 24, 2007 2:40 am
Posts: 6
In the example from reference:

Code:
<class name="Person">
<id name="id" column="personId">
<generator class="native"/>
</id>
<join table="PersonAddress"
optional="true">
<key column="personId" unique="true"/>
<many-to-one name="address"
column="addressId"
not-null="true"/>
</join>
</class>
<class name="Address">
<id name="id" column="addressId">
<generator class="native"/>
</id>
</class>


there is no mention of address property in the mapping of person class. Then how does hibernate figure that out?


Top
 Profile  
 
 Post subject: Re: unidirectional many-to-one using join table
PostPosted: Fri Jan 29, 2010 3:47 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
there is no mention of address property in the mapping of person class


In the example you posted the address property is mentioned:
Code:
<many-to-one name="address" column="addressId" not-null="true"/>


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.