Hello!
Can anyone help me with maps of Lists of entitys? Is this possible in Hibernate? I have three classes:
public class Room {
private String name; // this is assigned key
// other data
}
public class Student {
private String identifier; // this is assigned key
// other data
}
public class Exam {
private Integer id; // this is key
private Map<Room,List<Student>> schedule = new HashMap<Room, List<Student>>(50);
/*
* What X-doclet tags to put here?
*/
public Map<Room,List<Student>> getSchedule() {
return schedule;
}
}
In database, I expect a table "schedule" like this:
create table schedule (
exam_id bigint not null,
room_id varchar(30) not null,
list_index integer not null,
student_id varchar(30) not null,
primary key(exam_id, room_id, list_index)
);
What X-doclet tags should I put in description of Exam.getSchedule to achieve this; ie. to Hibernate use it as expected?
Thanks!
|