Skip to content

Nested structure not persistable that goes beyond a first level of a parent child relationship #1771

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
rudolfschmidt opened this issue Apr 14, 2024 · 4 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@rudolfschmidt
Copy link

Hey,
I thought I did something wrong first, but I noticed that you cannot save children that depend on the children of a aggregate parent.

Scenario:
you have a type A that is an aggregate that you want to save. Type A has children of type B and Type B has children of type C.
It's possible to save type A with children of type B but children of type C are not saved because data-jdbc expact type C to have a foreign key to type A and IMO that is nonsense.

@rudolfschmidt rudolfschmidt changed the title Nested structure not persistable that goes beyond first level of a parent child relationship Nested structure not persistable that goes beyond a first level of a parent child relationship Apr 14, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 14, 2024
@schauder
Copy link
Contributor

Could you clarify what "cannot save children" means? Doesn't the data get saved? Or is it a problem with loading it again? Do you get an exception?

This might be a duplicate of #1692 but with the current description it is impossible to tell.

I need either confirmation that this is a duplicate of the issue mentioned above or a reproducer.

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 16, 2024
@rudolfschmidt
Copy link
Author

rudolfschmidt commented Apr 16, 2024

Cannot save children means that he expects a foreign key to type A and because of that it throws an error. You have to use the foreign key for type B in type C and not for type A.

Do you have any test cases for a nested structure until level 2 or above?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 16, 2024
@schauder
Copy link
Contributor

Nothing in Spring Data JDBC checks the existence of a foreign key. Could you please at least post the full stack trace?

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Apr 17, 2024
@schauder
Copy link
Contributor

I'm interpreting your comment here #1692 (comment) as this being another duplicate of #1692

@schauder schauder closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@schauder schauder added status: duplicate A duplicate of another issue and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants