-->
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.  [ 1 post ] 
Author Message
 Post subject: Using bag as un-indexed lists
PostPosted: Sun Jun 19, 2005 1:04 am 
Beginner
Beginner

Joined: Wed Jun 15, 2005 2:00 pm
Posts: 38
Hi,

I'm using Hibernate 3.0.5. I've read in the reference the following in section 7.2.3

Code:
If your table doesn't have an index column, and you still wish to use List as the property type, you should map the property as a Hibernate <bag>. A bag does not retain its order when it is retrieved from the database, but it may be optionally sorted or ordered


How do I "optionally sort/order" the bag?

I've used the generation tools to generate the Java objects, and found that the bag maps into a Collection in the java class. So do I cast it into a sub-class that is sorted, and then perform the sort?

Any ideas on this, anyone? Thanks!


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

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.