-->
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: one-to-one relationship
PostPosted: Tue Sep 06, 2005 6:49 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
I spent sometime looking at the documentation looking for how to do one-to-one mapping and get the feeling that for unidirectional one to one relationships say between table A & table B, the table which has the foreign key ( let us say if B has a1 column where a1 is the primary key of A ) seems to own the one-to-one relationship - which means the class that gets generated for B would have the get & set for A. I was wondering if there was a way to do it the other way round - given that it is one-to-one.
To elaborate
Let Table A have pka, Table B has pkb, pka ( foreign key )
Now I guess the mapping file would be
<class A>... </class A>
<class B>

..

<one-to-one>....</one-to-one>
</class B>
Thus B is maintaing this relationship. I want in the object model for A to maintain this relationship even though in the relational model the column might be present in B


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.