-->
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: Mapping Issues
PostPosted: Fri Sep 07, 2007 1:34 am 
Newbie

Joined: Fri Sep 07, 2007 1:29 am
Posts: 1
Hi,
I have a Table called Address. That is common to both Supplier and Customer.Relationship between Supp to Add is one-to-many.Same from Customer to Address. How we are differentiating is htrough a type field in Address either "Supplier" or "Customer"

How can i able to do the mapping in Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 07, 2007 3:12 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
What's the problem ? Just do your mapping, there is nothing particular here. You just can't have not null constraint on your foreign keys with this mapping.

Personaly I prefer using inheritance between supplier and customer to have juste one foreign key from address to person but this is a matter of taste

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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.