How to control depth on custom Spring Data Neo4j repository methods?

心不动则不痛 提交于 2019-12-04 05:44:43

Derived finders do not yet support a depth. You'll have to write a custom query or use the loadAllByProperty method on the Neo4jTemplate if applicable.

This should have been mentioned in the docs, we'll add it.

As of SDN 4.2.0-M1, this feature has been implemented. It hasn't made it to the reference documentation at the time of this writing, but see this PR for implementation, tests and example app updates.

In short, derived finder methods can now sport a @Depth(n) annotation to specify a fetch depth of n (ref). You can also add a @Depth-annotated argument to method signatures that can be used to specify the fetch depth on each call (ref).

Cheers, @Luanne - this looks great :)

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