Hibernate Query pagination with JOIN FETCH and database limit/offset
The goal is to configure Hibernate ORM pagination via setFirstResult and setMaxResults so that LIMIT/OFFSET is generated by the dialect and the database applies paging before results are materialized. The queries use JOIN FETCH to load an entity graph in a single round trip. Dialect support for limit/offset can vary by query structure, and Hibernate may fall