-->
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.  [ 1 post ] 
Author Message
 Post subject: N:M relation -> additional data field
PostPosted: Mon Jun 07, 2010 5:42 am 
Newbie

Joined: Tue Jun 01, 2010 10:18 am
Posts: 15
Hello!

I am a Hibernate newbie and I have this relation to include:
Image

I have projects and I have users. One Project can have many Users and one User can be in many Projects, so I have a n:m relation between these two entities.

A User-Project relation is also "identified" by the role of a user in a project, for example "Project Manager", "Softare Developer", ... (there are 5-6 roles which are possible). But first, I am not sure if this is right to use this field "role" as a String in Java (varchar in MySQL) or should I create another entity called Role and map this to the table "ProjectUser"?
What do you think?

If I will do this in this kind how I illustrated it, I have used this for a bidirectional mapping:
http://tadtech.blogspot.com/2007/09/hib ... in_03.html

But there is no mapping of the additional data field, in my case "role". How can I integrate this in my annotations?

Thanks a lot in advcane & Best Regards PHANTOMIAS


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.