Interface CypherdslStatementExecutor<T>

Type Parameters:
T - The domain type of the repository

@API(status=STABLE, since="6.1") public interface CypherdslStatementExecutor<T>
An interface that can be added to any imperative repository so that the repository exposes several methods taking in a Statement from the Cypher-DSL, that allows for full customization of the queries executed in a programmatic way in contrast to provide custom queries declaratively via @Query annotations.
Since:
6.1
Author:
Michael J. Simons
  • Method Summary

    Modifier and Type
    Method
    Description
    findAll(org.neo4j.cypherdsl.core.Statement statement)
    Find all elements of the domain as defined by the statement.
    findAll(org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingAndReturn statement, org.neo4j.cypherdsl.core.Statement countQuery, Pageable pageable)
    The pages here are built with a fragment of a Statement: An ongoing reading with an attached return.
    <PT> Page<PT>
    findAll(org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingAndReturn statement, org.neo4j.cypherdsl.core.Statement countQuery, Pageable pageable, Class<PT> projectionClass)
    The pages here are built with a fragment of a Statement: An ongoing reading with an attached return.
    <PT> Collection<PT>
    findAll(org.neo4j.cypherdsl.core.Statement statement, Class<PT> projectionClass)
    Creates a custom projection of the repository type by a Cypher-DSL based statement.
    findOne(org.neo4j.cypherdsl.core.Statement statement)
    Find one element of the domain as defined by the statement.
    <PT> Optional<PT>
    findOne(org.neo4j.cypherdsl.core.Statement statement, Class<PT> projectionClass)
    Creates a custom projection of the repository type by a Cypher-DSL based statement.
  • Method Details

    • findOne

      Optional<T> findOne(org.neo4j.cypherdsl.core.Statement statement)
      Find one element of the domain as defined by the statement. The statement must return either no or exactly one mappable record.
      Parameters:
      statement - A full Cypher statement, matching and returning all required nodes, relationships and properties
      Returns:
      An empty optional or an optional containing the single element
    • findOne

      <PT> Optional<PT> findOne(org.neo4j.cypherdsl.core.Statement statement, Class<PT> projectionClass)
      Creates a custom projection of the repository type by a Cypher-DSL based statement. The statement must return either no or exactly one mappable record.
      Type Parameters:
      PT - The type of the projection
      Parameters:
      statement - A full Cypher statement, matching and returning all required nodes, relationships and properties
      projectionClass - The class of the projection type
      Returns:
      An empty optional or an optional containing the single, projected element
    • findAll

      Collection<T> findAll(org.neo4j.cypherdsl.core.Statement statement)
      Find all elements of the domain as defined by the statement.
      Parameters:
      statement - A full Cypher statement, matching and returning all required nodes, relationships and properties
      Returns:
      An iterable full of domain objects
    • findAll

      <PT> Collection<PT> findAll(org.neo4j.cypherdsl.core.Statement statement, Class<PT> projectionClass)
      Creates a custom projection of the repository type by a Cypher-DSL based statement.
      Type Parameters:
      PT - The type of the projection
      Parameters:
      statement - A full Cypher statement, matching and returning all required nodes, relationships and properties
      projectionClass - The class of the projection type
      Returns:
      An iterable full of projections
    • findAll

      Page<T> findAll(org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingAndReturn statement, org.neo4j.cypherdsl.core.Statement countQuery, Pageable pageable)
      The pages here are built with a fragment of a Statement: An ongoing reading with an attached return. The next step is ordering the results, and that order will be derived from the pageable. The same applies for the values of skip and limit.
      Parameters:
      statement - The almost complete statement that actually matches and returns the nodes and relationships to be projected
      countQuery - The statement that is executed to count the total number of matches for computing the correct number of pages
      pageable - The definition of the page
      Returns:
      A page full of domain objects
    • findAll

      <PT> Page<PT> findAll(org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingAndReturn statement, org.neo4j.cypherdsl.core.Statement countQuery, Pageable pageable, Class<PT> projectionClass)
      The pages here are built with a fragment of a Statement: An ongoing reading with an attached return. The next step is ordering the results, and that order will be derived from the pageable. The same applies for the values of skip and limit.
      Type Parameters:
      PT - The type of the projection
      Parameters:
      statement - The almost complete statement that actually matches and returns the nodes and relationships to be projected
      countQuery - The statement that is executed to count the total number of matches for computing the correct number of pages
      pageable - The definition of the page
      projectionClass - The class of the projection type
      Returns:
      A page full of projections