-->
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: Collection Mapping
PostPosted: Fri Nov 16, 2007 11:35 am 
Newbie

Joined: Fri Nov 16, 2007 10:27 am
Posts: 5
I have the following tables: Orders, OrderItems, Products. There are the normal foreign-keys between them.

I am able to map Orders to OrderItems, but I can't figure out how to map Orders to Products.

Is this possible?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 3:39 pm 
Newbie

Joined: Wed Dec 28, 2005 5:44 am
Posts: 12
one order can have many products

so you can have many-to-one mapping in your product.hbm.xml

have a getter and setter of that property in your "Product" bean class

Regards.
MJ


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.