-->
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: setFirstResult pagination
PostPosted: Mon Jul 25, 2005 10:28 am 
Beginner
Beginner

Joined: Thu Oct 14, 2004 5:07 am
Posts: 37
Location: Cambridge, UK
Hibernate version:3.0.5


I have been using setFirstResult and setMaxResults to perform pagination successfully for quite some time using a fairly static data set.

I now want to use the same solution, but the data is slightly more dynamic and between pages, some data in the initial (page 1) query, may have fallen out of scope...

This gives me a problem (that I have not actually yet seen, but conceptually I think will happen), in that if I have:

- page sizes of 10
- 21 objects *iniitally returned from the query numbered 1 to 21...

When I access the first page, I see object id's 1 to 10 which is fine...

But when I press next (page), I set setFirstResult(10), but because object id 1 has fallen out of scope (of my query), object id 11 is now the 10th object and therefore does not get displayed at the top of page 2 (which is what I want..)

What I really want instead of setFirstResult, is a setFirstResultObjectId > 10 which should then return object id 11 at the top of page 2 as expected...

Has anyone experienced this and got a workaround for it?




Name and version of the database you are using:Oracle 9i


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.