-->
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: One-to-one mapping between 2 non-primary keys
PostPosted: Thu Dec 13, 2007 1:32 pm 
Newbie

Joined: Thu Dec 13, 2007 1:22 pm
Posts: 1
Hi,

Can anybody help me with what should be a simple mapping in Hibernate 3.0 ?

I require a simple uni-directional one-to-one mapping between two tables where neither join column on both tables is a primary key. The following basic declaration allows me to specify the join column, via a property-ref, on the table I am joining to ...

<one-to-one name="cduRec" property-ref="pcisNumber"/>

This works fine, however it stills attempts to map the id column in the enclosing mapping file to that column. I wish to specify an alternative column.

Thx


Top
 Profile  
 
 Post subject: Re: One-to-one mapping between 2 non-primary keys
PostPosted: Sat Dec 15, 2007 10:54 am 
Newbie

Joined: Tue Nov 27, 2007 6:11 am
Posts: 12
delian wrote:
one-to-one mapping between two tables where neither join column on both tables is a primary key.


Not sure to get it right, but it sounds as a (database) design problem to me.


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.