[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Eclipselink Pagination across sessions
|
It should always be the same irrespective of which page you are fetching:
query.setFirstResult(start_result);
query.setMaxRows( pageSize);
clientSession.executeQuery(query);
clientSession.logout();
so that will be:
query.setFirstResult(0);
query.setMaxRows( 25);
clientSession.executeQuery(query);
clientSession.logout();
in first iteration
and
query.setFirstResult(25);
query.setMaxRows( 25);
clientSession.executeQuery(query);
clientSession.logout();
in second iteration
and:
query.setFirstResult(50);
query.setMaxRows( 25);
clientSession.executeQuery(query);
clientSession.logout();
in third iteration.
-------------------------------------------------------------------------------------------
On Mon, Jan 31, 2011 at 10:18 AM, Rohit Banga
<rohit.banga@xxxxxxxxxx> wrote:
Hi All
For Example:
query1.setFirstResult(firstResult);
query1.setMaxRows(maxRows);
clientSession1.executeQuery(query1);
clientSession1.logout();
.
.
.
query2.setFirstResult(firstResult + pageSize);
&n!
bsp; query2.setMaxRows(maxRows + pageSize);
clientSession2.executeQuery(query2);
clientSession2.logout();
Is the above correct? Does it work for all databases?
What if the selection criteria is different in query1 and query2?
Thanks
Rohit Banga
Member Technical Staff
Oracle Server Technologies
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users