Server-Side Pagination in Hibernate with setFirstResult and setMaxResults
How to implement server-side pagination in Hibernate using setFirstResult/setMaxResults and the Criteria API, with stable ordering, SQL verification, and fixes for collection fetch join pitfalls.