"Hibernate"-ing maps
- From: marcupic@xxxxxxxxx
- Date: 29 Dec 2006 07:40:01 -0800
Hi!
I'm using Java + Hibernate for data persistence, but I'm stuck on
hibernating second-order collections (collection of collections). I
asked this on Hibernate User Forum but got no response. What I'm trying
to do is this:
class Exam {
...
private Map<Room,List<Student>> schedule = new HashMap<Room,
List<Student>>(50);
...
}
Exam, Room and Student are all entitys, with their ID-s. Although
database model for storing "schedule" is trivial:
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)
);
I don't know how to tell Hibernate to create/use it. I dont directly
write hibernate xml descriptors, but use X-doclet for this task. So, if
anyone can tell me what X-doclet tags to write on getSchedule() method?
Thanks!
PS. If hibernate does not support this, that would also be valuable
information...
.
- Prev by Date: newbie, problem with hibernate
- Previous by thread: newbie, problem with hibernate
- Index(es):
Relevant Pages
|