Hi,

Please, tell me if I'm thinking the right way!!

I have a PRODUCT, which has a relationship with INVENTORY in many-to-many mode. 
This relationship has also several attributes, so I must create a intermediary 
table (PRODUCT_INVENTORY). I'm in doubt among 3 solutions:

1 - Create a PRODUCT_INVENTORY with a composite key (idProduct + idInventory) 
using @IdClass.

2 - Create a PRODUCT_INVENTORY with a composite key (idProduct + idInventory) 
using @Embeddable.

3 - Create a PRODUCT_INVENTORY with a auto-generated id plus to foreign keys 
(idProduct and idInventory).

Which one could be the best? Do you have any references about this subject?

Thanks. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972450#3972450

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972450
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to