Usually pagination queries look like this. Is there a better way instead of making two almost equal methods, one of which executing \"select *...\" and the other one \"count
I found a way to do paging in hibernate without doing a select count (*) over a large dataset size. Look at the solution that I posted for my answer here.
processing a large number of database entries with paging slows down with time
you can perform paging one at a time without knowing how many pages you will need originally