-->
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 Type for java.util.ArrayList
PostPosted: Tue Nov 18, 2003 12:40 am 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Hi folks,
I would like to know if there is an equivalent type in Hibernate for java.util.ArrayList. I tried to use "set", but because duplicates are not allowed in a set, I got ClassCastException. I am new to Hibernate and I am using XDoclet to generate the mapping file. This is for a one-to-many mapping and I need to do this for a getter/setter in the parent, which has the children information in a java.util.ArrayList. Please advise.
Thanks.
Madhan.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 12:48 am 
Senior
Senior

Joined: Tue Sep 23, 2003 8:18 am
Posts: 137
Location: Johannesburg, South Africa
Try using a <bag> instead of a set. As bags allow for duplicates.

Do a search on "bag" in the reference document and you'll find where it says that it allows for duplicates, etc.

-G


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 6:34 pm 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Thank you very much. I am trying "bag" with java.util.List and it works fine.


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.