-->
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.  [ 2 posts ] 
Author Message
 Post subject: Paging records using hibernate
PostPosted: Thu Apr 26, 2007 7:53 am 
Newbie

Joined: Tue Mar 20, 2007 11:48 am
Posts: 11
Hi to all,

Is there a way to make hibernate return rows from a query within a given row boudary (for example row 1-5), so that paging can be made simple? It should work database-independent too..

Thanks already.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2007 8:15 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,

you can use
i) query.setMaxResults(n) ;
ii) query.setFirstResult(m) ;

You can have a look at scrollableResultSets.
http://www.hibernate.org/hib_docs/v3/re ... pagination
----------------------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.