-
Notifications
You must be signed in to change notification settings - Fork 617
Include all nodes of a path during mapping. #2114
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
🤦 Oh dear. Thank you so much. |
There are a couple of scenarios where not all nodes or not all relationships of a path have been included in the mapping. First of call we filtered on the wrong path segment as documented by @Jafeyyu in this ticket and in some scenarios the synthesization of values did not include the segments in such a way that everything in the result was actually used in the mapping. This is fixed by synthesizing a result that has the form as a custom query (root node, all relationships and all related nodes), instead of going through the paths. |
This changes the logic of path mapping. We now synthesize a result that has the form as a custom query would have (root node, all relationships and all related nodes), instead of going through the paths. This simplifies the entity converter by a magnitude. Thus, we automatically include all nodes of a given type when we are not interested in the relation in a query like `MATCH p=()-[:IS_SIBLING_OF]-> () RETURN p`, include the last node in the path as an related object, are independent of both the direction that has been used for querying when filling in relationships and also have the same results regardless whether the paths is odd or even numbered. This fixes #2114.
I think you are right, I thought so before, but I don't know how to describe it, because my English is not very good, because of this problem, I put the version at 5.6.3 in my project,Thank you for fixed it. |
No worries, your contribution is appreciated, I wouldn't have the issue so soon without it. Take care! |
spring-data-neo4j/src/main/java/org/springframework/data/neo4j/core/mapping/DefaultNeo4jEntityConverter.java
Line 487 in f18e15a
The Nodes of Path need to filter should be PATH_START and PATH_END,but there is PATH_START and PATH_START
The text was updated successfully, but these errors were encountered: