-->
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 - Changing Direction Of Association
PostPosted: Sun Feb 04, 2007 2:04 pm 
Beginner
Beginner

Joined: Fri Sep 08, 2006 2:55 am
Posts: 21
I've got a mapping question, related to NHibernate 1.2.

Say I have TableA associated with ClassA and TableB associated with ClassB.

The relationship between ClassA and ClassB is one to one but for various reasons I can't give the two tables the same primary key value so I use <many-to-one unique="true".../> and so the primary key of TableB becomes a foreign key in TableA.

At some point I realise my design is flawed and ClassB should reference ClassA.

My question is thus can I do this without changing my database design?

The only way I can see to do it is to change things around so that the primary key of TableA becomes a foreign key in TableB.


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.