public class SingleStatementCypherCompiler extends Object implements CypherCompiler
CypherCompiler that builds a single query for the object graph.| Constructor and Description |
|---|
SingleStatementCypherCompiler() |
| Modifier and Type | Method and Description |
|---|---|
CypherContext |
compile()
Compiles the current request and returns the compile context, which
includes all the statements to be executed and related information
|
CypherContext |
context()
Returns this compiler's context
|
NodeBuilder |
existingNode(Long existingNodeId)
Returns a
NodeBuilder that represents a node that already exists in the database and matches the given ID. |
RelationshipBuilder |
existingRelationship(Long existingRelationshipId)
Returns a
RelationshipBuilder to use for constructing Cypher to update an existing relationship in the database
that possesses the given ID. |
List<ParameterisedStatement> |
getStatements()
Retrieves the Cypher queries that have been built up through this
CypherCompiler. |
RelationshipBuilder |
newBiDirectionalRelationship()
Returns a
RelationshipBuilder to use for constructing Cypher for writing a new directed relationship in both directions to the database. |
NodeBuilder |
newNode()
Returns
NodeBuilder that represents a new node to be created in the database. |
RelationshipBuilder |
newRelationship()
Returns a
RelationshipBuilder to use for constructing Cypher for writing a new relationship to the database. |
String |
nextIdentifier() |
void |
relate(String startNode,
String relationshipType,
Map<String,Object> relationshipProperties,
String endNode)
Deprecated.
|
void |
release(RelationshipBuilder relationshipBuilder)
Returns an unused relationship's reference to the ref pool
This is to ensure that references are only created when needed
|
void |
unrelate(String startNode,
String relationshipType,
String endNode,
Long relId)
Defines a relationship deletion between the specified start node to end node with the given relationship type and direction.
|
@Deprecated public void relate(String startNode, String relationshipType, Map<String,Object> relationshipProperties, String endNode)
CypherCompilerrelate in interface CypherCompilerstartNode - The NodeBuilder representation of the relationship start noderelationshipType - The type of relationship to create between the nodesrelationshipProperties - The (optional) Map containing the properties of the relationshipendNode - The NodeBuilder representation of the relationship end nodepublic void unrelate(String startNode, String relationshipType, String endNode, Long relId)
CypherCompilerunrelate in interface CypherCompilerstartNode - The NodeBuilder representation of the relationship start noderelationshipType - The type of relationship between the nodes to deleteendNode - The NodeBuilder representation of the relationship end noderelId - The id of the relationship to unrelatepublic NodeBuilder newNode()
CypherCompilerNodeBuilder that represents a new node to be created in the database.newNode in interface CypherCompilerNodeBuilder representing a new nodepublic NodeBuilder existingNode(Long existingNodeId)
CypherCompilerNodeBuilder that represents a node that already exists in the database and matches the given ID.existingNode in interface CypherCompilerexistingNodeId - The ID of the node in the databaseNodeBuilder representing the node in the database that corresponds to the given IDpublic RelationshipBuilder newRelationship()
CypherCompilerRelationshipBuilder to use for constructing Cypher for writing a new relationship to the database.newRelationship in interface CypherCompilerRelationshipBuilderpublic RelationshipBuilder newBiDirectionalRelationship()
CypherCompilerRelationshipBuilder to use for constructing Cypher for writing a new directed relationship in both directions to the database.newBiDirectionalRelationship in interface CypherCompilerRelationshipBuilderpublic RelationshipBuilder existingRelationship(Long existingRelationshipId)
CypherCompilerRelationshipBuilder to use for constructing Cypher to update an existing relationship in the database
that possesses the given ID.existingRelationship in interface CypherCompilerexistingRelationshipId - The ID of the relationship in the database, which shouldn't be nullRelationshipBuilder bound to the identified relationshippublic List<ParameterisedStatement> getStatements()
CypherCompilerCypherCompiler.
Please node that there is no requirement that implementations of CypherCompiler provide an idempotent or
even deterministic implementation of this method. Therefore, it's recommended to only call this method once
after all query building has been completed.
getStatements in interface CypherCompilerList of Cypher queries to be executed or an empty list if there aren't any, never nullpublic CypherContext context()
CypherCompilercontext in interface CypherCompilerpublic CypherContext compile()
CypherCompilercompile in interface CypherCompilerpublic void release(RelationshipBuilder relationshipBuilder)
CypherCompilerrelease in interface CypherCompilerrelationshipBuilder - the RelationshipBuilderpublic String nextIdentifier()
nextIdentifier in interface CypherCompilerCopyright © 2015 Neo Technology, Inc.. All rights reserved.