-->
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: Collections - One to Many - Using List
PostPosted: Mon Nov 24, 2003 7:37 pm 
Newbie

Joined: Fri Oct 17, 2003 12:40 pm
Posts: 16
I have a Parent and two children, with one to many relationship. I have defined the one to many relationships with set, everything works fine. But I want a list of children, so I tried with list. I get a error "Element "list" requires additional elements". When I looked at the documentation, I found that I need to add a index column. Do I need to add the index column in the database.
I don't want to add any new column in the database. In this case, am I forced to use a set and then convert my set to a List?


Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2003 7:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
A list requires the index so it knows where to position the element in the collection. So your answer is yes you will need the extra column if you want the collection mapped to a list.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2003 9:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a bag instead.


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.