Interface ExecutableStatement
- All Known Subinterfaces:
ExecutableResultStatement
,ReactiveExecutableResultStatement
,ReactiveExecutableStatement
executeWithXXX
methods, the driver must be present on the class path. The corresponding Java module
is org.neo4j.driver
.
An ExecutableResultStatement
makes a ResultStatement
executable.
We don't add any overhead to the process but only use what's already there. The QueryRunner
passed to any
of the methods can be a session, a transaction or also the Spring Data Neo4j specific query runner.
We don't commit or rollback any transaction nor do we close a session. That is up to the caller.
Any parameter in this statement containing a value will be passed directly to the driver. The driver does
a relatively good job converting most parameters. If in doubt or the result is wrong, use an appropriate overload of
org.neo4j.driver.Values#value(parameter)
to convert the parameter.
Use any of the of(Statement)
or makeExecutable(Statement)
methods to get an appropriate instance.
The of
methods are useful when you are using qualified imports, the makeExecutable
-variant comes in
handy with static imports.
- Since:
- 2021.2.1
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture
<org.neo4j.driver.summary.ResultSummary> executeWith
(org.neo4j.driver.async.AsyncQueryRunner queryRunner) If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunner
to the statement, execute it and retrieve a result summary in an asynchronous fashionorg.neo4j.driver.summary.ResultSummary
executeWith
(org.neo4j.driver.SimpleQueryRunner queryRunner) If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunner
to the statement, execute it and retrieve a result summary.@NotNull String
@NotNull Collection
<String> static ExecutableResultStatement
makeExecutable
(ResultStatement statement) Creates an executable result statement based on the given statementstatic ExecutableStatement
makeExecutable
(Statement statement) Creates an executable statement based on the given statementstatic ExecutableResultStatement
of
(ResultStatement statement) Creates an executable result statement based on the given statementstatic ExecutableStatement
Creates an executable statement based on the given statement
-
Method Details
-
makeExecutable
Creates an executable statement based on the given statement- Parameters:
statement
- Any Cypher-DSL statement- Returns:
- An executable statement. Maybe a
ExecutableResultStatement
, depending on the input. - See Also:
-
makeExecutable
Creates an executable result statement based on the given statement- Parameters:
statement
- A Cypher-DSL result statement- Returns:
- An executable result statement.
- See Also:
-
of
Creates an executable statement based on the given statement- Parameters:
statement
- Any Cypher-DSL statement- Returns:
- An executable statement. Maybe a
ExecutableResultStatement
, depending on the input. - See Also:
-
of
Creates an executable result statement based on the given statement- Parameters:
statement
- A Cypher-DSL result statement- Returns:
- An executable result statement.
- See Also:
-
getParameters
- Returns:
- A map of all parameters with a bound value.
- See Also:
-
getParameterNames
- Returns:
- A set of parameter names being used.
- See Also:
-
getCypher
- Returns:
- A valid Cypher statement
- See Also:
-
executeWith
org.neo4j.driver.summary.ResultSummary executeWith(org.neo4j.driver.SimpleQueryRunner queryRunner) If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunner
to the statement, execute it and retrieve a result summary.All parameters with given values will be passed to the database. Please have a look at
ResultStatement
for further details about parameter conversionsNo resources passed to this method (neither sessions, transactions nor other query runners) will be closed. Resources opened inside the method will be closed.
- Parameters:
queryRunner
- a query runner- Returns:
- A result summary (including server information, counters etc).
-
executeWith
CompletableFuture<org.neo4j.driver.summary.ResultSummary> executeWith(org.neo4j.driver.async.AsyncQueryRunner queryRunner) If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunner
to the statement, execute it and retrieve a result summary in an asynchronous fashionAll parameters with given values will be passed to the database. Please have a look at
ResultStatement
for further details about parameter conversionsNo resources passed to this method (neither sessions, transactions nor other query runners) will be closed. Resources opened inside the method will be closed.
- Parameters:
queryRunner
- a query runner- Returns:
- A completable future of a result summary (including server information, counters etc).
-