【发布时间】:2018-06-27 03:33:29
【问题描述】:
Spring Data Neo4j 提供了一种指定查询深度的方法:
@Depth(value = 2)
List<KNode> findByName(String name);
但是它是硬编码的,有没有其他方法可以将深度指定为方法的参数,就像:
List<KNode> findByName(String name, int depth);
谢谢。
【问题讨论】:
Spring Data Neo4j 提供了一种指定查询深度的方法:
@Depth(value = 2)
List<KNode> findByName(String name);
但是它是硬编码的,有没有其他方法可以将深度指定为方法的参数,就像:
List<KNode> findByName(String name, int depth);
谢谢。
【问题讨论】:
您可以尝试对参数进行注释。
List<KNode> findByName(String name, @Depth int depth);
在此处了解更多信息:https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#reference_derived-queries
【讨论】: