Skip to content
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

Fetching an aggregate root-entity-set chain results in wrong data for the set #1802

Closed
vpmuli opened this issue Jun 3, 2024 · 1 comment
Closed
Assignees
Labels
type: regression A regression from a previous release

Comments

@vpmuli
Copy link

vpmuli commented Jun 3, 2024

Check the attached example project. Run DemoApplicationTests to see the problem. I noticed this on Spring Data JDBC 3.2.5. Also applies to 3.3.0. 3.1.12 works as expected. It seems to me that the id of the root table is erroneously used for fetching the set. This is highly dangerous as wrong data is returned and if the returned aggregate is saved back to the database then the wrong set data is persisted.

bug.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 3, 2024
@vpmuli
Copy link
Author

vpmuli commented Jun 4, 2024

Converting the Second record to a class with setters fixes the problem. Immutable class also has this bug.

@schauder schauder self-assigned this Jun 7, 2024
@schauder schauder added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 7, 2024
schauder added a commit that referenced this issue Jun 7, 2024
In an aggregate A->B-Collection<C> a select gets executed for loading Collection<C>.
That select used the wrong ID when B had an ID with the same name as A.

This is now fixed.

Closes #1802
@mp911de mp911de added this to the 3.2.7 (2023.1.7) milestone Jun 10, 2024
mp911de added a commit that referenced this issue Jun 10, 2024
Simplify code. Remove redundant calls.

Reformat code, remove trailing whitespaces, remove duplicate tests.

See #1802
Original pull request: #1810
mp911de pushed a commit that referenced this issue Jun 10, 2024
In an aggregate A->B-Collection<C> a select gets executed for loading Collection<C>.
That select used the wrong ID when B had an ID with the same name as A.

This is now fixed.

Closes #1802
Original pull request: #1810
mp911de added a commit that referenced this issue Jun 10, 2024
Simplify code. Remove redundant calls.

Reformat code, remove trailing whitespaces, remove duplicate tests.

See #1802
Original pull request: #1810
mp911de pushed a commit that referenced this issue Jun 10, 2024
In an aggregate A->B-Collection<C> a select gets executed for loading Collection<C>.
That select used the wrong ID when B had an ID with the same name as A.

This is now fixed.

Closes #1802
Original pull request: #1810
mp911de added a commit that referenced this issue Jun 10, 2024
Simplify code. Remove redundant calls.

Reformat code, remove trailing whitespaces, remove duplicate tests.

See #1802
Original pull request: #1810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants