-->
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.  [ 3 posts ] 
Author Message
 Post subject: a contact class with many-to-one with 2 other classes.
PostPosted: Thu Jan 11, 2007 9:53 pm 
Regular
Regular

Joined: Fri Feb 03, 2006 5:28 pm
Posts: 73
Location: Québec, QC, Canada
Hi,

lets say I have a contact class.

a project class and a company class.

a project may have zore or more contacts. the same goes for company.

how would that work? Both the contact & company class would have a bag of contact.

in the db, the contact table would have to have IdCompany and IdProject in it?

what if many other classes may have 0 or many contacts.. the table contact would have many Ids which would always be null but one, right?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 11:36 pm 
Senior
Senior

Joined: Sat Mar 25, 2006 9:16 am
Posts: 150
you need to model them as many-to-many relationships


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 12:15 am 
Regular
Regular

Joined: Fri Feb 03, 2006 5:28 pm
Posts: 73
Location: Québec, QC, Canada
can you elaborate?

many contact to many project

many contact to one company

many contact to many other object..

so I guess I can set multiple many 2 many and use a many to one for company, right?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.