-->
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: How can I map a more to more relation, but with one atribute
PostPosted: Thu Feb 05, 2004 3:27 pm 
Newbie

Joined: Thu Feb 05, 2004 3:17 pm
Posts: 1
I need to represent just that.
My english is very bad, so I show you one E-R diagram:

---------- ----------- ---------
| Name |------------->| Name | | |
---------- | Event |<--------|Event |
| Posts | ---------
| |
-----------

One user could be register in one or more Event, and in one Event could be registered one or more users. To here I can do, but what happen if I need to remember the number of posts that one user made in one event.

I hope that you understand me, and thanks for read,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 3:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check the ternary association.

You'll have
User
===
one-to-many UserEventPost

Event
====
one-to-many UserEventPost

UserEventPost
=========
many-to-one User
many-to-one Event
many-to-one Post

If Post can handle many-to-one to User and event, then replace UserEventPost by Post

_________________
Emmanuel


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.