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 TypeMethodDescriptionfindAll
(org.neo4j.cypherdsl.core.Statement statement) Find all elements of the domain as defined by thestatement
.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 aStatement
: Anongoing 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 aStatement
: Anongoing reading with an attached return
.<PT> Collection<PT>
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 thestatement
.<PT> Optional<PT>
Creates a custom projection of the repository type by a Cypher-DSL based statement.
-
Method Details
-
findOne
Find one element of the domain as defined by thestatement
. 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
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 propertiesprojectionClass
- The class of the projection type- Returns:
- An empty optional or an optional containing the single, projected element
-
findAll
Find all elements of the domain as defined by thestatement
.- 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 propertiesprojectionClass
- 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 aStatement
: Anongoing reading with an attached return
. The next step is ordering the results, and that order will be derived from thepageable
. 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 projectedcountQuery
- The statement that is executed to count the total number of matches for computing the correct number of pagespageable
- 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 aStatement
: Anongoing reading with an attached return
. The next step is ordering the results, and that order will be derived from thepageable
. 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 projectedcountQuery
- The statement that is executed to count the total number of matches for computing the correct number of pagespageable
- The definition of the pageprojectionClass
- The class of the projection type- Returns:
- A page full of projections
-