-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping with two classes and java.util.List
PostPosted: Thu Oct 14, 2004 4:57 am 
Newbie

Joined: Wed Jul 07, 2004 5:35 am
Posts: 7
Location: L
Hibernate version:2.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:HSQLDB v. 1.7.1

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hey there,

i have a problem with my mapping files. I have two custom classes. One named Week and one named Day. The fields of the classes are as followed:

Week: - weekID : int
- weekNumber: int
- year : int
- dayList : java.util.List (--> should contain Day objects)

Day: - dayID :int
- weekID :int
- day :java.lang.String
- date :java.util.Date

Now i want to get a Week object that contains in the dayList the Day objects associated to this Week(weekNumber and Year). My Primary keys are weekID in the Week class and dayID in the Day class. My foreign key is weekID in the Day class.
How should my mapping file look like, to get the Day objects into the java.util.List of the Week class?

Thanks for your help!
CU
Torben Werner


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 1:37 pm 
Beginner
Beginner

Joined: Fri Aug 13, 2004 3:07 pm
Posts: 44
I think your question is best answered by the parent-child relationship in the hibernate documentation. It seems you are following the exact same things described there.

_________________
Thanks
Sameet


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.