Hello,
I'm doing a directory listing using Hibernate and, to avoid having tons of data every query, I'm using:
Criteria paging = sess.createCriteria(Principal.class);
paging.setFirstResult((int) resultSetStart);
paging.setMaxResults(resultSetSize);
...
List<Principal> principals = paging.list();
Now, this works fine: I guess exactly resultSetSize
results. However, I want to do something like Google has, 'showing page X out of Y'.
How can I know the total number of entries? Or the total number of pages?