-->
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 unidirectional 1-to-1 w/ foreign key in wrong table
PostPosted: Tue Oct 09, 2007 7:03 pm 
Newbie

Joined: Tue Aug 21, 2007 5:01 pm
Posts: 3
Hopefully, this is a simple mapping question.

Class A has a 1-1 unidirectional mapping to Class B, but in the schema I'm working with Table B has the foreign-key mapping back to Table A.

I can't use a one-to-one mapping because I'm not using a shared primary key. Nor can I use a many-to-one mapping with unique="true" and column="fkcol" because the foreign key is on the wrong table.

Theoretically, it should work fine to have the foreign-key on Table B identifying the one-to-one association, but how do I map this? Of course, changing the schema is not an option.


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.