Inconsistent page size when using Hibernate fetch join with setMaxResults
When a Hibernate query uses a fetch join (e.g., left join fetch) together with pagination via setFirstResult and setMaxResults, the application expects each page to contain a exact number of distinct root entities. However, the LIMIT/OFFSET clause is applied to the joined result set before Hibernate removes duplicate rows, so the number of distinct entities