AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Hibernate"-ing maps

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Fri Dec 29, 2006 9:40 pm    Post subject: "Hibernate"-ing maps Reply with quote



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...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.