Hibernate ORM Pagination Configuration with Join Fetches
Hibernate provides setFirstResult() and setMaxResults() to implement database-level pagination. While these methods typically translate to LIMIT or OFFSET clauses based on the SQL dialect, the behavior changes when JOIN FETCH is used to retrieve associated collections. When a query fetches a OneToMany relationship, the resulting Cartesian product can conflic