Skip to content

Regression in 3.0 when combining 1:n relation, @EntityGraph and Pageable #2702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
steffen-schaefer opened this issue Nov 16, 2022 · 2 comments
Assignees
Labels
for: external-project For an external project and not something we can fix

Comments

@steffen-schaefer
Copy link

Hello,

We identified an issue in 3.0.0 snapshots regarding paging under the following circumstances:

  • Entity A has a 1:n relation to entity B
  • There are A entries having multiple B values
  • Using a spring data JPA query with Pageable parameter and Page result
  • An @entitygraph is added to the query which includes loading the collection of B values on A

In this case, the following happens:

  • The resulting query includes a left join on B which in combination with paging returns less results than requested via Pageable
  • The resulting Page's totalElements is equal to the number of values contained in the page

The described scenario works fine using 2.7.x.

A minimal reproduction scenario is attached
demo.zip

Thanks in advance!

@schauder
Copy link
Contributor

schauder commented Dec 13, 2022

I turned your demonstrator in a GitHub repository and reproduced the issue using the EntityManager directly.

I therefore conclude that this is a Hibernate regression and you'd need to file an issue with them to get it fixed.

@schauder schauder closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
@schauder schauder added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 13, 2022
@steffen-schaefer
Copy link
Author

Thank you for the thorough analysis. We filed an issue in Hibernate Jira: https://hibernate.atlassian.net/browse/HHH-15880

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants