public abstract class Statement
extends java.lang.Object
Unlike JDBC in which statements are created from a connection, the Neo4J Driver actually allows developers to create as many statements as they like on a single transaction (supported through the Connection#add(Statement) method).
Results are also specific to the statement and can be retrieved via the #getResult() method.
NOTE: This API will probably change to support a builder style Statement builder.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
includeStats |
protected java.util.Map<java.lang.String,java.lang.Object> |
parameters |
protected java.lang.String |
statement |
| Constructor and Description |
|---|
Statement(java.lang.String query)
Create a new Statement for the provided cypher query.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getQuery()
Retrieves the query used in this statement.
|
abstract java.lang.String |
getType()
Returns either "row" or "graph".
|
int |
hashCode() |
void |
setParam(java.lang.String key,
java.lang.Object value)
Neo4J supports parameter binding in cypher by inserting { paramName } into the query.
|
JSONObject |
toJson()
Converts this object to a JSONObject.
|
protected final java.lang.String statement
protected final java.util.Map<java.lang.String,java.lang.Object> parameters
protected boolean includeStats
public Statement(java.lang.String query)
query - The cypher query to execute.public java.lang.String getQuery()
public void setParam(java.lang.String key,
java.lang.Object value)
You can set a parameter using this method.
key - The parameter to set.value - The value to replace the parameter with.public abstract java.lang.String getType()
public JSONObject toJson()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object