Server-Side Pagination with the JPA Criteria API in Hibernate 5.2+ and 6.x
Implement efficient server-side pagination in Hibernate 5.2+ and 6.x using the JPA Criteria API (CriteriaBuilder/CriteriaQuery). Avoid OutOfMemoryErrors, understand the collection fetch trap (HHH000104), and verify database-level LIMIT/OFFSET generation.