-->
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: Many-to-Many Relation Table with additional Values
PostPosted: Wed Oct 17, 2007 5:14 pm 
Newbie

Joined: Wed Oct 17, 2007 4:59 pm
Posts: 8
Hi together,
for my next big webproject I have to deal with a strange problem.

Let's assume we have two tables,

Code:
producer                   customer
----------------           ---------------
p_id *                      c_id *
name                        name

which are connected with a many-to-many relation.
For saving the individual provision I want to add this integer
field in the automatic created relationtable as can be seen in the following example:

Code:
producer                 producer_2_customer                 customer
----------------          -------------------------          ---------------
p_id *                    p_id*                               c_id *
name                      c_id*                               name
                          provision                     


Now I have two problems:
    How can solve this problem in the mapping file?
    How do I have to code my Java-Classes to work with this combination?
    Any other solution for this kind of problem?


Kind regards for a quick help
Fritz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 5:38 pm 
Newbie

Joined: Wed Oct 17, 2007 4:59 pm
Posts: 8
ok i think i found some infos... looks like the composite-element is the answer...

but should i use the composite-element or just modeling an own entity which is located "in the middle" with an one-to-many an a many-to-one relation...

Im confused.


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.