-
Notifications
You must be signed in to change notification settings - Fork 616
Support multiple relationships properties to same node #2228
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
Comments
Thanks for reporting this. I can reproduce it with the expanded test case, you provided. |
We target this issue with another bugfix. If you want, you could give |
Sorry, but that test doesn't pass even with the latest changes. I've tried both the 6.0.x branch and main. Maybe you missed here the changes in the AltHobby class |
I did in the last run...back to the drawing board. |
When using relationship properties, it is possible to map towards the same node multiple times. While loading this was not supported because the logic assumed that after one relationship was found, the mapping to this node is done.
Ok, finally. I somehow forgot about the change on my machine. |
I can confirm that this error no longer occurs even in my more complex model |
Great to hear and thanks for your feedback. |
When using relationship properties, it is possible to map towards the same node multiple times. While loading this was not supported because the logic assumed that after one relationship was found, the mapping to this node is done.
When using relationship properties, it is possible to map towards the same node multiple times. While loading this was not supported because the logic assumed that after one relationship was found, the mapping to this node is done. Closes #2228
In my case, I need a fully hydrated Node for modifying and save() without data loss.
My datas has more @RelationshipProperties between same nodes.
To simulate this I modified existing unit test:
org.springframework.data.neo4j.integration.imperative.RepositoryIT.RelationshipProperties
Everything is OK until I add to AltHobby node new property with getter()
Then I have error on assertThat(likedBy).hasSize(2)
java.lang.AssertionError: Expected size:<2> but was:<1> in: <[org.springframework.data.neo4j.integration.shared.common.AltLikedByPersonRelationship@3f3af232]> at org.springframework.data.neo4j.integration.imperative.RepositoryIT$RelationshipProperties.loadSameNodeWithDoubleRelationship(RepositoryIT.java:1570)
My model has more complex mappings but this is the simple case where this error is visible. Maybe is there another way how to change and save node without data lose and loading whole tree of relationships.
The text was updated successfully, but these errors were encountered: