Interface ExecutableStatement
-
- All Known Subinterfaces:
ExecutableResultStatement,ReactiveExecutableResultStatement,ReactiveExecutableStatement
@API(status=EXPERIMENTAL, since="2021.2.1") public interface ExecutableStatementThis interface spots several methods that allow statements to be used with an instance of the Neo4j Java Driver. To use any of theexecuteWithXXXmethods, the driver must be present on the class path. The corresponding Java module isorg.neo4j.driver.An
ExecutableResultStatementmakes aResultStatementexecutable.We don't add any overhead to the process but only use what's already there. The
QueryRunnerpassed 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)ormakeExecutable(Statement)methods to get an appropriate instance. Theofmethods are useful when you are using qualified imports, themakeExecutable-variant comes in handy with static imports.- Since:
- 2021.2.1
- Author:
- Michael J. Simons
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.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 aQueryRunnerto the statement, execute it and retrieve a result summary in an asynchronous fashionorg.neo4j.driver.summary.ResultSummaryexecuteWith(org.neo4j.driver.QueryRunner queryRunner)If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunnerto the statement, execute it and retrieve a result summary.@NotNull java.lang.StringgetCypher()@NotNull java.util.Collection<java.lang.String>getParameterNames()@NotNull java.util.Map<java.lang.String,java.lang.Object>getParameters()static ExecutableResultStatementmakeExecutable(ResultStatement statement)Creates an executable result statement based on the given statementstatic ExecutableStatementmakeExecutable(Statement statement)Creates an executable statement based on the given statementstatic ExecutableResultStatementof(ResultStatement statement)Creates an executable result statement based on the given statementstatic ExecutableStatementof(Statement statement)Creates an executable statement based on the given statement
-
-
-
Method Detail
-
makeExecutable
static ExecutableStatement makeExecutable(Statement statement)
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(Statement)
-
makeExecutable
static ExecutableResultStatement makeExecutable(ResultStatement statement)
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(ResultStatement)
-
of
static ExecutableStatement of(Statement statement)
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(Statement)
-
of
static ExecutableResultStatement of(ResultStatement statement)
Creates an executable result statement based on the given statement- Parameters:
statement- A Cypher-DSL result statement- Returns:
- An executable result statement.
- See Also:
makeExecutable(ResultStatement)
-
getParameters
@NotNull @Contract(pure=true) @NotNull java.util.Map<java.lang.String,java.lang.Object> getParameters()
- Returns:
- A map of all parameters with a bound value.
- See Also:
Statement.getParameters()
-
getParameterNames
@NotNull @Contract(pure=true) @NotNull java.util.Collection<java.lang.String> getParameterNames()
- Returns:
- A set of parameter names being used.
- See Also:
Statement.getParameterNames()
-
getCypher
@NotNull @Contract(pure=true) @NotNull java.lang.String getCypher()
- Returns:
- A valid Cypher statement
- See Also:
Statement.getCypher()
-
executeWith
org.neo4j.driver.summary.ResultSummary executeWith(org.neo4j.driver.QueryRunner queryRunner)
If the Neo4j Java Driver is on the classpath, this method can be used to pass aQueryRunnerto 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
ResultStatementfor 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
java.util.concurrent.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 aQueryRunnerto 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
ResultStatementfor 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).
-
-