We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
spring-boot-starter-data-neo4j:3.2.5
There is a problem that the @RelationshipId member is null in the return value of Neo4jOperations#save and CrudRepository#save.
@RelationshipId
null
Neo4jOperations#save
CrudRepository#save
But relationship ID of refetched node after saved is non null.
Is this the intended behavior?
I tried to test based on the official sample.
https://github.com/spring-projects/spring-data-neo4j/blob/main/src/test/java/org/springframework/data/neo4j/documentation/spring_boot/TemplateExampleTest.java
@Test void relationshipIdOfSavedEntityShouldBeNonNull(@Autowired Neo4jTemplate neo4jTemplate) { MovieEntity movie = new MovieEntity("The Love Bug", "A movie that follows the adventures of Herbie, Herbie's driver, " + "Jim Douglas (Dean Jones), and Jim's love interest, " + "Carole Bennett (Michele Lee)"); Roles roles1 = new Roles(new PersonEntity(1931, "Dean Jones"), Collections.singletonList("Didi")); Roles roles2 = new Roles(new PersonEntity(1942, "Michele Lee"), Collections.singletonList("Michi")); movie.getActorsAndRoles().add(roles1); movie.getActorsAndRoles().add(roles2); MovieEntity result = neo4jTemplate.save(movie); assertThat(result.getActorsAndRoles()).allSatisfy(relationship -> { assertThat(relationship.getId()).isNotNull(); }); }
This test fails because the relationship ID is null.
@Test void relationshipIdOfFetchedEntityShouldBeNonNull(@Autowired Neo4jTemplate neo4jTemplate) { MovieEntity movie = new MovieEntity("The Love Bug", "A movie that follows the adventures of Herbie, Herbie's driver, " + "Jim Douglas (Dean Jones), and Jim's love interest, " + "Carole Bennett (Michele Lee)"); Roles roles1 = new Roles(new PersonEntity(1931, "Dean Jones"), Collections.singletonList("Didi")); Roles roles2 = new Roles(new PersonEntity(1942, "Michele Lee"), Collections.singletonList("Michi")); movie.getActorsAndRoles().add(roles1); movie.getActorsAndRoles().add(roles2); neo4jTemplate.save(movie); Optional<MovieEntity> result = neo4jTemplate.findById("The Love Bug", MovieEntity.class); assertThat(result).hasValueSatisfying(value -> { assertThat(value.getActorsAndRoles()).allSatisfy(relationship -> { assertThat(relationship.getId()).isNotNull(); }); }); }
On the other hand, the relationship ID of the fetched node is non null, so this test succeeds.
The text was updated successfully, but these errors were encountered:
Thanks for your report. This is a bug and a fix is under way.
Sorry, something went wrong.
fix: Update relationship properties objects before populating result …
9a125e2
…entities. Closes #2904
1905248
0355a2a
0bae3c7
michael-simons
No branches or pull requests
Version
spring-boot-starter-data-neo4j:3.2.5
Description
There is a problem that the
@RelationshipId
member isnull
in the return value ofNeo4jOperations#save
andCrudRepository#save
.But relationship ID of refetched node after saved is non null.
Is this the intended behavior?
Testing
I tried to test based on the official sample.
https://github.com/spring-projects/spring-data-neo4j/blob/main/src/test/java/org/springframework/data/neo4j/documentation/spring_boot/TemplateExampleTest.java
This test fails because the relationship ID is null.
On the other hand, the relationship ID of the fetched node is non null, so this test succeeds.
The text was updated successfully, but these errors were encountered: