neo4j / sdn-rx

Nextgen Spring Data module for Neo4j supporting (not only) reactive data access and immutable support
https://neo4j.github.io/sdn-rx
Apache License 2.0
65 stars 23 forks source link

Use idDescription when mapping relations #259

Closed utnaf closed 4 years ago

utnaf commented 4 years ago

We noticed that createInstanceOfRelationships in DefaultNeo4jConverter uses requiredIdProperty to match the related entities.

If the node entity uses @Property on an id field this won't be correctly resolved by the method. Look at the test that reproduces the use case.

Thanks to @conker84 for the help.

utnaf commented 4 years ago

Thanks @utnaf. A great catch again. I have only minor change requests in the test (hopefully for consistency with what we have) and one change in the code itself:

We can rely on the fact that the id description won't be null in case there is an id property so that we can avoid creating unnecessary Optional's on a hot path.

Thanks very much for your effort!!

Thanks for the review @michael-simons, sorry for the delay 😄 I implemented your suggestions!

michael-simons commented 4 years ago

Merged. 👍