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
|