- All Implemented Interfaces:
AsyncQueryRunner
- Direct Known Subclasses:
InternalAsyncSession
,InternalAsyncTransaction
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal CompletionStage<ResultCursor>
Run a query asynchronously and return aCompletionStage
with a result cursor.final CompletionStage<ResultCursor>
Run a query asynchronously and return aCompletionStage
with a result cursor.final CompletionStage<ResultCursor>
Run a query asynchronously and return aCompletionStage
with a result cursor.final CompletionStage<ResultCursor>
Run a query asynchronously and return aCompletionStage
with a result cursor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.neo4j.driver.async.AsyncQueryRunner
runAsync
-
Constructor Details
-
AsyncAbstractQueryRunner
public AsyncAbstractQueryRunner()
-
-
Method Details
-
runAsync
Description copied from interface:AsyncQueryRunner
Run a query asynchronously and return aCompletionStage
with a result cursor.This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.
This particular method takes a
Value
as its input. This is useful if you want to take a map-like value that you've gotten from a prior result and send it back as parameters.If you are creating parameters programmatically,
AsyncQueryRunner.runAsync(String, Map)
might be more helpful, it converts your map to aValue
for you.Example
CompletionStage<ResultCursor> cursorStage = session.runAsync( "MATCH (n) WHERE n.name = $myNameParam RETURN (n)", Values.parameters("myNameParam", "Bob"));
CompletionStage
. See class javadoc for more information.- Specified by:
runAsync
in interfaceAsyncQueryRunner
- Parameters:
query
- text of a Neo4j queryparameters
- input parameters, should be a map Value, seeValues.parameters(Object...)
.- Returns:
- new
CompletionStage
that gets completed with a result cursor when query execution is successful. Stage can be completed exceptionally when error happens, e.g. connection can't be acquired from the pool.
-
runAsync
Description copied from interface:AsyncQueryRunner
Run a query asynchronously and return aCompletionStage
with a result cursor.This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.
This version of runAsync takes a
Map
of parameters. The values in the map must be values that can be converted to Neo4j types. SeeValues.parameters(Object...)
for a list of allowed types.Example
Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("myNameParam", "Bob"); CompletionStage<ResultCursor> cursorStage = session.runAsync( "MATCH (n) WHERE n.name = $myNameParam RETURN (n)", parameters);
CompletionStage
. See class javadoc for more information.- Specified by:
runAsync
in interfaceAsyncQueryRunner
- Parameters:
query
- text of a Neo4j queryparameters
- input data for the query- Returns:
- new
CompletionStage
that gets completed with a result cursor when query execution is successful. Stage can be completed exceptionally when error happens, e.g. connection can't be acquired from the pool.
-
runAsync
Description copied from interface:AsyncQueryRunner
Run a query asynchronously and return aCompletionStage
with a result cursor.This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.
This version of runAsync takes a
Record
of parameters, which can be useful if you want to use the output of one query as input for another.It is not allowed to chain blocking operations on the returned
CompletionStage
. See class javadoc for more information.- Specified by:
runAsync
in interfaceAsyncQueryRunner
- Parameters:
query
- text of a Neo4j queryparameters
- input data for the query- Returns:
- new
CompletionStage
that gets completed with a result cursor when query execution is successful. Stage can be completed exceptionally when error happens, e.g. connection can't be acquired from the pool.
-
runAsync
Description copied from interface:AsyncQueryRunner
Run a query asynchronously and return aCompletionStage
with a result cursor.It is not allowed to chain blocking operations on the returned
CompletionStage
. See class javadoc for more information.- Specified by:
runAsync
in interfaceAsyncQueryRunner
- Parameters:
query
- text of a Neo4j query- Returns:
- new
CompletionStage
that gets completed with a result cursor when query execution is successful. Stage can be completed exceptionally when error happens, e.g. connection can't be acquired from the pool.
-