Skip to content

Path resolution in Repository #2470

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

Closed
paulux84 opened this issue Jan 18, 2022 · 8 comments
Closed

Path resolution in Repository #2470

paulux84 opened this issue Jan 18, 2022 · 8 comments

Comments

@paulux84
Copy link

Repository does not map to object result with only one node when cypher return path.

In the following example ServiceEntity (Service) contains a list (ServiceOption) that is correctly hydrated. In the meantime, all Service without relationships (the first match) are not returned as ServiceEntity from Repository while neo4j correctly returns it as result of a direct query to DB.

@Query("match p=(s:Service) where ID(s) IN $iterable return p " +
            "union match p=(:Service)-[:HAS_OPTION]->(option:ServiceOption) " +
            "where ID(option) IN $iterable return p")
    List<ServiceEntity> findAllByServiceOrServiceOptionId(Iterable<Long> iterable);

Thanks for your works,
Paolo

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 18, 2022
meistermeier added a commit that referenced this issue Jan 20, 2022
@meistermeier
Copy link
Collaborator

Thanks for reporting this.
It seems that an empty path returned by the single node was not correctly respected in SDN.
There will be a 6.2.2-GH-2470-SNAPSHOT available in ~30 minutes containing the fix. Would be great to get your feedback on this.

@meistermeier meistermeier added blocked: awaiting feedback and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 20, 2022
@paulux84
Copy link
Author

Great, I'll try the fix as soon as possible and reply to you with the results.
Thanks again

@paulux84
Copy link
Author

Hi again,
the problem seems to persist. This are my new dependencies:

./mvnw dependency:tree | grep neo4j
[INFO] +- org.springframework.boot:spring-boot-starter-data-neo4j:jar:2.6.2:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:6.2.2-GH-2470-SNAPSHOT:compile
[INFO] |  +- org.neo4j:neo4j-cypher-dsl:jar:2021.4.2:compile
[INFO] |  +- org.neo4j.driver:neo4j-java-driver:jar:4.3.6:compile

@meistermeier
Copy link
Collaborator

Could you provide some data and/or reproducer?
For the pattern above I created two Services of which one is connected to a ServiceOption.
You can see the example here https://github.com/meistermeier/neo4j-issues-examples/tree/master/gh-2470
If you would comment the 6.2.2-GH-2470-SNAPSHOT dependency, the app will fail.

@paulux84
Copy link
Author

Your code example is correct and the fix here seems to work. I'll searching for some dependency error in my project.

@paulux84
Copy link
Author

paulux84 commented Jan 28, 2022

Solved, thanks...the fix works. My problem is related to old dependency cache.

@paulux84 paulux84 reopened this Jan 28, 2022
@paulux84
Copy link
Author

when will this fix be merged in a release branch?

@michael-simons
Copy link
Collaborator

https://calendar.spring.io

VMWare plans the releases.

cc @mp911de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants