-->
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: Contingency Table
PostPosted: Sun Apr 30, 2006 2:01 pm 
Newbie

Joined: Wed Apr 26, 2006 5:28 am
Posts: 18
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 2:32 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
Read the documentation regarding the mapping of many-to-many relationships

radu


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 02, 2006 3:56 am 
Newbie

Joined: Wed Apr 26, 2006 5:28 am
Posts: 18
radu wrote:
Read the documentation regarding the mapping of many-to-many relationships

radu

Thank you for your help.


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.