-->
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: Sorting a set at runtime
PostPosted: Sun Jun 20, 2004 3:14 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
How can I sort a collection mapped as a set at runtime?

I've tried session.filter(node.getNodes(), "ORDER BY name ASC"); but it seems like it returns a new collection instead of sorting the collection itself.

When Hibernate lazy loads the node.getNodes() in the view it is still unordered.

I can implement a Comparator but would like to sort the collection in SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 20, 2004 3:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
<set order-by="...">


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 20, 2004 3:29 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
gavin wrote:
<set order-by="...">


Thanks for the quick answer but I want to sort the collection at runtime.

session.filter seems to sort a copy of the collection so I cannot use that.


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.