- All Implemented Interfaces:
AsyncQueryRunner
- Direct Known Subclasses:
InternalAsyncSession,InternalAsyncTransaction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CompletionStage<ResultCursor> Run a query asynchronously and return aCompletionStagewith a result cursor.final CompletionStage<ResultCursor> Run a query asynchronously and return aCompletionStagewith a result cursor.final CompletionStage<ResultCursor> Run a query asynchronously and return aCompletionStagewith a result cursor.final CompletionStage<ResultCursor> Run a query asynchronously and return aCompletionStagewith a result cursor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.neo4j.driver.async.AsyncQueryRunner
runAsync
-
Constructor Details
-
AsyncAbstractQueryRunner
public AsyncAbstractQueryRunner()
-
-
Method Details
-
runAsync
Description copied from interface:AsyncQueryRunnerRun a query asynchronously and return aCompletionStagewith 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
Valueas 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 aValuefor you.Example
It is not allowed to chain blocking operations on the returnedCompletionStage<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:
runAsyncin interfaceAsyncQueryRunner- Parameters:
query- text of a Neo4j queryparameters- input parameters, should be a map Value, seeValues.parameters(Object...).- Returns:
- new
CompletionStagethat 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:AsyncQueryRunnerRun a query asynchronously and return aCompletionStagewith 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
Mapof 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
It is not allowed to chain blocking operations on the returnedMap<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:
runAsyncin interfaceAsyncQueryRunner- Parameters:
query- text of a Neo4j queryparameters- input data for the query- Returns:
- new
CompletionStagethat 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:AsyncQueryRunnerRun a query asynchronously and return aCompletionStagewith 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
Recordof 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:
runAsyncin interfaceAsyncQueryRunner- Parameters:
query- text of a Neo4j queryparameters- input data for the query- Returns:
- new
CompletionStagethat 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:AsyncQueryRunnerRun a query asynchronously and return aCompletionStagewith a result cursor.It is not allowed to chain blocking operations on the returned
CompletionStage. See class javadoc for more information.- Specified by:
runAsyncin interfaceAsyncQueryRunner- Parameters:
query- text of a Neo4j query- Returns:
- new
CompletionStagethat 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.
-