Depth in custom Cypher queries with OGM always 0?

吃可爱长大的小学妹 提交于 2019-12-03 15:51:22

The default depth 1 refers to findOne/findAll/.. methods from the repository and derived finders.

This is what the documentation says about custom queries:

In the current version, custom queries do not support paging, sorting or a custom depth. In addition, it does not support mapping a path to domain entities, as such, a path should not be returned from a Cypher query. Instead, return nodes and relationships to have them mapped to domain entities.

http://docs.spring.io/spring-data/data-neo4j/docs/current/reference/html/#reference:session:loading-entities:cypher-queries

For example when you have a query

MATCH (n:MyLabel)-[r]-(n2)
WHERE ... // some condition
RETURN n,r,n2

list all nodes/relationships you want to map to your objects in the RETURN clause.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!