I understand how basic pagination works, and have been successful at using it in Hibernate with the setMaxResults and setFirstResult api on the criteria object.
However, now I have the a problem where the user wants to display the page of results that contains a particular key of information. For instance, if there are 10000 total rows with 10 rows per page, there are then 1000 pages of 10 rows. Based on a particular key supplied during the query, the user would want to see page 3 of data with that item selected in the results.
How can I specify this key in a criteria to ensure that the result set returns with the page of data from hibernate includes the key, and most importantly, keeps that key in its proper position within the page of data?
Thanks in advance,
Mark
|