-->
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: How do I model this?
PostPosted: Tue Apr 11, 2006 8:41 pm 
Newbie

Joined: Tue Apr 11, 2006 8:27 pm
Posts: 1
Hi

I got the following situation:

I got users and lectures in a university. One user attends to 0...n lectures, a lecture is beeing attended by 0...n users. If a user attends to a lecture, he has a role. A role is a very simple thing, it could be just a int or char, 1 for lecturer, 0 for student or so.

So how should I model this? I use Annotations for defining mappings. My current Idea looks like this:

public class Lecture {
/* Student is the student attending to the lecture, Integer is the role */
private Map<Student, Integer> students;
}

public class Student {
/* Lecture is a lectures the student attends, Integer is the role the student has there */
private Map<Lecture, Integer> lectures;
}

So how do I add Annotations to this to make this work? Or how should I change my code?


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.