Search code examples
neo4jspring-dataspring-data-neo4jspring-data-neo4j-4

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


For example, if I want to get list of users by name:

class UserRepository extands GraphRepository<User> {

    List<User> findByName(String name);
}

then how to set loading depth to 2?

I tried to find answer in the SDN 4.0.0.RC2 docs, but it isn't contains anything about this issue.


Solution

  • 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.