Annotation Interface Query


@Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) @Documented @API(status=STABLE, since="6.0") public @interface Query
Annotation to provide Cypher statements that will be used for executing the method. The Cypher statement may contain named parameters as supported by the >Neo4j Java Driver. Those parameters will get bound to the arguments of the annotated method.
Since:
6.0
Author:
Michael J. Simons
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    A flag if the value() should be used as counting query.
    The Cypher statement for counting the total number of expected results.
    boolean
    A flag if the value() should be used as deletion query.
    boolean
    A flag if the value() should be used as existential query.
    The custom Cypher query to get executed and mapped back, if any return type is defined.
  • Element Details

    • value

      String value
      The custom Cypher query to get executed and mapped back, if any return type is defined.
      Returns:
      a Cypher query
      Default:
      ""
    • countQuery

      String countQuery
      The Cypher statement for counting the total number of expected results. Only needed for methods returning pages or slices based on custom queries.
      Returns:
      a Cypher query for counting entities
      Default:
      ""
    • count

      boolean count
      A flag if the value() should be used as counting query.
      Returns:
      whether the query defined should be executed as count projection.
      Default:
      false
    • exists

      boolean exists
      A flag if the value() should be used as existential query.
      Returns:
      whether the query defined should be executed as exists projection.
      Default:
      false
    • delete

      boolean delete
      A flag if the value() should be used as deletion query.
      Returns:
      whether the query defined should be used to delete nodes or relationships.
      Default:
      false