Annotation Interface Cypher


@Retention(RUNTIME) @Target(METHOD) public @interface Cypher
Annotation for defining Cypher queries in Neo4J repositories. This annotation allows users to specify a Cypher query directly on repository methods, enabling custom query execution within Neo4JRepository. Example usage:
 
 @Cypher("MATCH (n:Person) WHERE n.name = $name RETURN n")
 List<Person> findByName(@Param("name") String name);
 
 
The value attribute should contain a valid Cypher query. Query parameters can be defined using the $parameterName syntax, which will be replaced by method parameters annotated with @Param.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The Cypher query to be executed.
  • Element Details

    • value

      String value
      The Cypher query to be executed.
      Returns:
      The Cypher query string.