Module org.neo4j.cypherdsl.core
Interface ExecutableResultStatement
- All Superinterfaces:
ExecutableStatement
This interface extends
ExecutableStatement
and adds several fetchWithXXX
methods that can be used
with any ResultStatement
to retrieve their results.
The same requirements for the needed classes apply as with ExecutableStatement
.
- Since:
- 2021.2.1
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture
<List<org.neo4j.driver.Record>> fetchWith
(org.neo4j.driver.async.AsyncQueryRunner queryRunner) Asynchronously fetches a list of records from a database via the givenqueryRunner
.<T> CompletableFuture
<List<T>> fetchWith
(org.neo4j.driver.async.AsyncQueryRunner queryRunner, Function<org.neo4j.driver.Record, T> mappingFunction) Asynchronously fetches a list of records from a database via the givenqueryRunner
.default List
<org.neo4j.driver.Record> fetchWith
(org.neo4j.driver.SimpleQueryRunner queryRunner) Fetches a list ofrecords
from a database via the givenqueryRunner
.<T> List
<T> fetchWith
(org.neo4j.driver.SimpleQueryRunner queryRunner, Function<org.neo4j.driver.Record, T> mappingFunction) Fetches a list of things from a database via the givenqueryRunner
.org.neo4j.driver.summary.ResultSummary
streamWith
(org.neo4j.driver.SimpleQueryRunner queryRunner, Consumer<Stream<org.neo4j.driver.Record>> streamHandler) This method creates (and closes) a stream of records from the result of a given query.Methods inherited from interface org.neo4j.cypherdsl.core.executables.ExecutableStatement
executeWith, executeWith, getCypher, getParameterNames, getParameters
-
Method Details
-
fetchWith
<T> List<T> fetchWith(org.neo4j.driver.SimpleQueryRunner queryRunner, Function<org.neo4j.driver.Record, T> mappingFunction) Fetches a list of things from a database via the givenqueryRunner
. ThemappingFunction
is used for converting records into a custom types.- Type Parameters:
T
- The type of the returned objects.- Parameters:
queryRunner
- Any type of query runner. Neither sessions nor transactions will be closed.mappingFunction
- A mapping function.- Returns:
- A list of objects.
-
fetchWith
Fetches a list ofrecords
from a database via the givenqueryRunner
.- Parameters:
queryRunner
- Any type of query runner. Neither sessions nor transactions will be closed.- Returns:
- A list of records.
-
fetchWith
<T> CompletableFuture<List<T>> fetchWith(org.neo4j.driver.async.AsyncQueryRunner queryRunner, Function<org.neo4j.driver.Record, T> mappingFunction) Asynchronously fetches a list of records from a database via the givenqueryRunner
. ThemappingFunction
is used for converting records into a custom types.- Type Parameters:
T
- The type of the returned objects- Parameters:
queryRunner
- Any type of asynchronous query runner. Neither sessions nor transactions will be closed.mappingFunction
- A mapping function.- Returns:
- A completable future of a list of records
-
fetchWith
default CompletableFuture<List<org.neo4j.driver.Record>> fetchWith(org.neo4j.driver.async.AsyncQueryRunner queryRunner) Asynchronously fetches a list of records from a database via the givenqueryRunner
.- Parameters:
queryRunner
- Any type of asynchronous query runner. Neither sessions nor transactions will be closed.- Returns:
- A completable future of a list of records
-
streamWith
org.neo4j.driver.summary.ResultSummary streamWith(org.neo4j.driver.SimpleQueryRunner queryRunner, Consumer<Stream<org.neo4j.driver.Record>> streamHandler) This method creates (and closes) a stream of records from the result of a given query. The stream is not meant to live outside the scope of the consumer passed to this method as it should either be closed or fully consumed (we make sure of this).This method is especially useful when profiling a statement: You will be able to safely process what's needed and also get hold of the result summary, which will include the profile.
- Parameters:
queryRunner
- Any type of query runner. Neither sessions nor transactions will be closedstreamHandler
- A handler for the stream: Do whatever you want with the items.- Returns:
- The result summary. There is no need to actually use this.
-