-
Notifications
You must be signed in to change notification settings - Fork 166
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
Neo4JRepoistory.save does not correctly updates @RelationshipEntity #607
Comments
It looks like this is related to the missing
or for 1:1
definition in |
I updated the code. As stated before adding the relation to the node does not change anything. So at least there is a new relation and also the return of save reflects this correctly (it returns a new id). But this does not changes the core problem (the title of this ticket):
Propbably a Relation repository would provide different methods than Neo4JRepository?! |
This provides example code and proof that the point ends of relationships can be updated. The update must happen in one transaction, together with the loading of the relationship. See related commit spring-projects/spring-data-neo4j@bbf7ec1 in Spring Data Neo4j. This closes #607.
This provides example code and proof that the point ends of relationships can be updated. The update must happen in one transaction, together with the loading of the relationship. See related commit spring-projects/spring-data-neo4j@bbf7ec1 in Spring Data Neo4j. This closes #607.
This provides example code and proof that the point ends of relationships can be updated. The update must happen in one transaction, together with the loading of the relationship. See related commit spring-projects/spring-data-neo4j@bbf7ec1 in Spring Data Neo4j. This closes #607.
I created an repo to demonstrate the issue (unit test fails):
https://github.com/dermoritz/neo4JSpringExamples
Test: https://github.com/dermoritz/neo4JSpringExamples/blob/master/src/test/java/com/example/neo4jbug/RoleRpositoryTest.java
There is a problem with calling Neo4JRepository.save to update a @RelationshipEntity.
The test creates a Movie and an Actor and puts them in realtion "Role" (this is an example from doc)
the first save persists the relation and nodes correctly - i check this by retireving the entity from repository.
Then i create a 2nd movie and set this as node in the former relation and save it.
While the save returns a correctly updated entity the persisted state in data base is different: The second movie is persisted but the relation is still between the actor and first movie:
My expectation is that this should just work: The entity returned by save should be reflect the new state in database - node correctly updated.
If it is not possible (by design) to update a relation's node either the save method should return an error.
The current state is really misleading and is contradicting to expectations or the "contract" of the spring data repository save method.
What does not help:
The text was updated successfully, but these errors were encountered: