-->
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: Maintaining the Order of the Collection in the IN expression
PostPosted: Tue Jul 25, 2006 5:37 pm 
Newbie

Joined: Tue Jul 25, 2006 5:18 pm
Posts: 1
Hi all,

I am new to Hibernate, as well as this list, so sorry if this question is basic or unclear...

I am trying to add a Restriction to a query so that given a Collection of ids, it will return results with those ids IN THE SAME ORDER.

I've used the "InExpression(String propertyName, Collection values)" with the following line of code:

oResult = oResult.add(Restrictions.in("vID", (Collection) oFilter.getValue()));

But this does not return the results in the same order as they were in the Collection.

Is there a way to maintain the order? Or is there a better way to do this?

Thanks so much in advance,
J


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.