Hibernate version: 1.0.2.0
Hi there,
how can I map a contingency table? I don't know if "contingency table" is the right english translation for what I mean so I try to explain:
For example you have a database where you store recipes. One recipe has several ingredients. These ingredients are store in an other table. Now one ingredient can also assigned to several recipes so i create a third table - the "contingency table" :
Code:
___________
|Recipe
|---------------
|*ID: int
|NAME: varchar(256)
|___________
|
|
/|\
--------------------
|Recipe_Ingredient
|---------------
|*ID: int
|Id_Recipe: int
|Id_Ingredient: int
|___________
\|/
|
|
---------------
|Ingredient
|---------------
|*ID: int
|NAME: varchar(256)
|___________
How can I map this kind of relation?
Thanks for help.