Interface ExecutableResultStatement
-
- All Superinterfaces:
ExecutableStatement
public interface ExecutableResultStatement extends ExecutableStatement
This interface extendsExecutableStatementand adds severalfetchWithXXXmethods that can be used with anyResultStatementto retrieve their results.The same requirements for the needed classes apply as with
ExecutableStatement.- Since:
- 2021.2.1
- Author:
- Michael J. Simons
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.CompletableFuture<java.util.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> java.util.concurrent.CompletableFuture<java.util.List<T>>fetchWith(org.neo4j.driver.async.AsyncQueryRunner queryRunner, java.util.function.Function<org.neo4j.driver.Record,T> mappingFunction)Asynchronously fetches a list of records from a database via the givenqueryRunner.default java.util.List<org.neo4j.driver.Record>fetchWith(org.neo4j.driver.QueryRunner queryRunner)Fetches a list ofrecordsfrom a database via the givenqueryRunner.<T> java.util.List<T>fetchWith(org.neo4j.driver.QueryRunner queryRunner, java.util.function.Function<org.neo4j.driver.Record,T> mappingFunction)Fetches a list of things from a database via the givenqueryRunner.org.neo4j.driver.summary.ResultSummarystreamWith(org.neo4j.driver.QueryRunner queryRunner, java.util.function.Consumer<java.util.stream.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 Detail
-
fetchWith
<T> java.util.List<T> fetchWith(org.neo4j.driver.QueryRunner queryRunner, java.util.function.Function<org.neo4j.driver.Record,T> mappingFunction)Fetches a list of things from a database via the givenqueryRunner. ThemappingFunctionis 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
default java.util.List<org.neo4j.driver.Record> fetchWith(org.neo4j.driver.QueryRunner queryRunner)
Fetches a list ofrecordsfrom 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> java.util.concurrent.CompletableFuture<java.util.List<T>> fetchWith(org.neo4j.driver.async.AsyncQueryRunner queryRunner, java.util.function.Function<org.neo4j.driver.Record,T> mappingFunction)Asynchronously fetches a list of records from a database via the givenqueryRunner. ThemappingFunctionis 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 java.util.concurrent.CompletableFuture<java.util.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.QueryRunner queryRunner, java.util.function.Consumer<java.util.stream.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.
-
-