Skip to content

Fixed EntityGraphFactory overwriting subgraphs #2571

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
wants to merge 1 commit into from

Conversation

pstrnad
Copy link
Contributor

@pstrnad pstrnad commented Jun 18, 2022

EntityGraphFactory doesn't check whether a subgraph for a joined entity has already been created, and instead always creates a new one which overwrites the previous one.

E.g. when properties "a.b.field" and "a.c.field" are passed, it will first create a subgraph for "a" with a nested subgraph for "b", then create a new subgraph for "a" with a nested subgraph for "c", which will replace the the previous subgraph for "a". Therefore, no eager join for the b entity will be generated.

Related ticket #2527

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@pivotal-cla
Copy link

@pstrnad Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@pstrnad Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 18, 2022
@laszlopalfi
Copy link

any updates on this?

@gregturn
Copy link
Contributor

Thanks @pstrnad!

@gregturn gregturn self-assigned this Dec 21, 2022
@gregturn gregturn added type: bug A general bug in: repository Repositories abstraction and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 21, 2022
@gregturn gregturn modified the milestone: 3.1 M1 (2022.1.0) Dec 21, 2022
@gregturn
Copy link
Contributor

It's been merged to main and backported to 3.0.x.

@gregturn gregturn closed this Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository Repositories abstraction type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants