-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate design
PostPosted: Thu Jan 29, 2004 9:20 pm 
Newbie

Joined: Thu Jan 29, 2004 8:59 pm
Posts: 3
This is a rather simple question about the best design model to use. I need to persist an object containing a list of objects that themselves contain a list of objects. I read in the manual that collections may not contain other collections. I also read about collections of components (composite-element) which seems to be an alternative way for a class that contains a collection to persist itself.
I'm a little confused as to which option to use for my application.

For example, I have a schedule class which contains a list of job objects, and each job object contains (among other things) a list of shift objects.

How should I implement this?


Top
 Profile  
 
 Post subject: Collections cannot contain collections
PostPosted: Thu Jan 29, 2004 11:54 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 8:13 pm
Posts: 31
Location: Newport Beach, CA
"Collections cannot contain collections"

I think this simply means you cannot have a Collection with elements of Collection.
You mentioned you have a Collection that contains elements with their own collection members. This is fine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is a bit OT but it seems to me that it's not very OO

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.