Closed rudolfschmidt closed 5 months ago
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.
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?
Nothing in Spring Data JDBC checks the existence of a foreign key. Could you please at least post the full stack trace?
I'm interpreting your comment here https://github.com/spring-projects/spring-data-relational/issues/1692#issuecomment-2059298013 as this being another duplicate of #1692
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.