A join multiplies rows, so Hibernate cannot page in SQL and warns before doing it in Java instead.
// Dangerous:
@Query("select o from Order o join fetch o.items")
Page<Order> paged(Pageable pageable);
WARN HHH90003004: firstResult/maxResults specified with collection fetch;
applying in memory
Fix: page the ids first, then fetch the items for that page.
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-11