-->
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: session.createFilter: order by collection index?
PostPosted: Fri Apr 02, 2010 7:15 pm 
Newbie

Joined: Thu Sep 15, 2005 10:04 am
Posts: 14
Hi,
I have a large list for which I want to support a paged iterator, so retrieve page by page of data from the db. I use session.createFilter and the setMaxResults() to implement the paging

However, how can I set that the returned data must be in the order of the listindex column? The list index column is not mapped so I can't just add an order by to the createFilter second parameter. I tried something like:
Code:
session.createFilter(collection, "order by index(this)");

This did not work (got a sql exception, function index not known).

Is there another/better and generic way I can accomplish this (return a sorted list by listindex from the createFilter method)?

Thanks for any insights in this!

gr. Martin


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.