Patel Amit wrote:
Hi,
I have a question about JPA Pagination. I'm using the setFirstResult
and setMaxResults on the JPA Query object. These features work great
(using OpenJPA 1.1.0). My question is, is there a way to get the total
number of results returned even with the page number settings set? For
example, if I set the MaxResults to 10, and the total results of the
query is 25 (without setting the MaxResults) is there a way to get the
25 value? Right now, I'm just issuing a second query without the
maxResults set and getting the collection size, but I'm wondering if
there is a more efficient way of doing it.
@see also
http://www.ilikespam.com/blog/paging-large-data-sets-with-a-lazylist
Thanks for the help.
Amit Patel