-->
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: Help with mapping objects/tables
PostPosted: Sat Feb 18, 2006 12:27 pm 
Newbie

Joined: Tue Dec 06, 2005 8:47 am
Posts: 16
Location: London
I am trying to create the following class and functionality

i have 2 tables

Products
ProdCode
ProdName

SupplierProducts
SupplierID
ProdCode

The product table is just a lookup to the details. A supplier can have many products. I want to get the details for a supplier including the product details.

What type of associaltion should i use. Some examples will be helpful.

Thanks


Top
 Profile  
 
 Post subject: Suggestion
PostPosted: Mon Feb 20, 2006 3:35 am 
Regular
Regular

Joined: Tue Jan 03, 2006 7:21 am
Posts: 85
I assume that you have another table called Supplier to store the Supplier details and the SupplierProducts table is the join table between Supplier and Products.

If your SupplierProducts table is just going to have SupplierID and ProductCode you can use a many-to-many relationship between Supplier and Products table. If you want to have more columns in the join table you can then model this as a 2 one-to-many relationships (this will require you to model SupplierProducts as a entity as well)


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.