-->
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: Mapping question
PostPosted: Fri Nov 30, 2007 3:46 pm 
Newbie

Joined: Tue Oct 16, 2007 3:42 pm
Posts: 11
Hi,

I have two tables I'm trying to map such that it forms a one-to-many (parent-child) relationship. The problem is that the foreign-key in the CHILDTABLE is not the primary-key of the PARENTTABLE. How would I map such a relationship? I'm trying to do this as follows (using property-ref instead of identifying the column directly), but it doesn't work.

The following is the relevant portion of the child POJO.

Code:
<many-to-one name="parent"
class="edu.nyu.tutorial.Parent"
property-ref="childId"
insert="false" update="false" unique="false"
optimistic-lock="true" not-found="exception" embed-xml="true"/>


Again, in the child POJO the PK is the "childId" but it is also supposed to be the FK. However, it is not the PK of the parent.

Any guidance as to what is wrong with the above would be helpful. thanks!


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.