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?
|