Hibernate Pagination: Transitioning from setFirstResult to ScrollableResults for Large Collections
Pagination Strategy for Large Datasets Hibernate ORM provides setFirstResult() and setMaxResults() to handle result set pagination. While these methods generate dialect-specific SQL (such as LIMIT/OFFSET), they can trigger significant performance issues when combined with join fetch on OneToMany collections. In these scenarios, Hibernate may perform paginati