@groovy.transform.CompileStatic class GraphPersistentEntity extends AbstractPersistentEntity<NodeConfig>
Represents an entity mapped to the Neo4j graph, adding support for dynamic labelling
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
LABEL_SEPARATOR |
|
protected static java.lang.String |
MATCH |
|
protected static java.lang.String |
MATCH_ID |
|
protected boolean |
assignedId |
|
protected java.lang.String |
batchCreateStatement |
|
protected java.lang.String |
batchId |
|
protected GraphClassMapping |
classMapping |
|
protected boolean |
hasDynamicAssociations |
|
protected boolean |
hasDynamicLabels |
|
protected IdGenerator |
idGenerator |
|
protected Type |
idGeneratorType |
|
protected java.util.Collection<java.lang.Object> |
labelObjects |
|
protected NodeConfig |
mappedForm |
|
protected boolean |
nativeId |
|
protected PersistentProperty |
nodeId |
|
protected boolean |
relationshipEntity |
|
protected java.util.Collection<java.lang.String> |
staticLabels |
|
protected java.lang.String |
variableId |
Constructor and description |
---|
GraphPersistentEntity
(java.lang.Class javaClass, MappingContext context) |
GraphPersistentEntity
(java.lang.Class javaClass, MappingContext context, boolean external) |
Type Params | Return Type | Name and description |
---|---|---|
|
private void |
appendRecursive(java.lang.StringBuilder sb, java.lang.Object domainInstance) |
|
protected java.lang.String |
calculateAssociationMatch(GraphPersistentEntity parent, GraphPersistentEntity child, Association association, java.lang.String var) |
|
protected IdGenerator |
createIdGenerator(java.lang.String generatorType) |
|
protected java.util.Collection<java.lang.Object> |
establishLabelObjects() |
|
protected boolean |
establishLabels() |
|
java.lang.String |
formatAssociationDelete(Association association, java.lang.Object entity) Formats an association merge |
|
java.lang.String |
formatAssociationMatch(Association association, java.lang.String var, java.lang.String start, java.lang.String end) Formats an association match |
|
java.lang.String |
formatAssociationMatchFromExisting(Association association, java.lang.String var, java.lang.String start, java.lang.String end) Formats an association match from an existing matched node |
|
java.lang.String |
formatAssociationMerge(Association association, java.lang.String start, java.lang.String end) Formats an association merge |
|
java.lang.String |
formatAssociationPatternFromExisting(Association association, java.lang.String var, java.lang.String start, java.lang.String end) Formats an association match from an existing matched node |
|
java.lang.String |
formatBatchCreate(java.lang.String batchId) Formats a batch UNWIND statement for the given id |
|
java.lang.String |
formatBatchCreate(java.lang.String parentVariable, Association association) Formats a batch FOREACH statement for populating association data |
|
java.lang.String |
formatDynamicAssociationQuery(java.lang.String variable) Formats a dynamic association query |
|
java.lang.String |
formatId(java.lang.String variable) Format a reference to the ID for cypher queries |
|
java.lang.String |
formatMatch(java.lang.String variable, java.lang.Object o) Formats a match for the ID for this entity |
|
java.lang.String |
formatMatchAndUpdate(java.lang.String variable, java.util.Map<java.lang.String, java.lang.Object> props) Formats a match for the ID for this entity |
|
java.lang.String |
formatMatchId(java.lang.String variable, java.lang.Object o) Formats a match for the ID for this entity |
|
java.lang.String |
formatNode(java.lang.String variable, java.lang.Object o) Format a match for a node to this entity node |
|
java.lang.String |
formatProperty(java.lang.String variable, java.lang.String property) Format a reference to the ID for cypher queries |
|
java.lang.String |
formatReturnId(java.lang.String variable) Format a reference to the ID for cypher queries |
|
java.lang.String |
getBatchCreateStatement()
|
|
java.lang.String |
getBatchId()
|
|
IdGenerator |
getIdGenerator()
|
|
Type |
getIdGeneratorType()
|
|
private java.lang.String |
getLabelFor(java.lang.Object obj, java.lang.Object domainInstance) |
|
java.util.Collection<java.lang.String> |
getLabels()
|
|
java.util.Collection<java.lang.String> |
getLabels(java.lang.Object domainInstance) Get labels specific to the given instance |
|
java.lang.String |
getLabelsAsString()
|
|
java.lang.String |
getLabelsAsString(java.lang.Object domainInstance) return all labels as string usable for cypher, concatenated by ":" @return |
|
java.lang.String |
getLabelsAsStringWithInheritance()
|
|
java.lang.String |
getLabelsWithInheritance(java.lang.Object domainInstance) recursively join all discriminators up the class hierarchy @return |
|
ClassMapping<NodeConfig> |
getMapping() |
|
PersistentProperty |
getNodeId()
|
|
java.lang.String |
getVariableId()
|
|
java.lang.String |
getVariableName()
|
|
boolean |
hasDynamicAssociations()
|
|
boolean |
hasDynamicLabels()
|
|
void |
initialize() |
|
boolean |
isAssignedId()
|
|
boolean |
isNativeId()
|
|
boolean |
isRelationshipEntity() |
|
java.io.Serializable |
readId(Entity entity) Reads the id from given Neo4j entity |
Formats an association merge
association
- The associationstart
- The start variableend
- The end variableFormats an association match
association
- The associationvar
- The variable name to use for the relationship. Defaults to 'r"start
- The start variable nameend
- The relationship variable nameFormats an association match from an existing matched node
association
- The associationvar
- The variable name to use for the relationship. Defaults to 'r"start
- The start variable nameend
- The relationship variable nameFormats an association merge
association
- The associationstart
- The start variableend
- The end variableFormats an association match from an existing matched node
association
- The associationvar
- The variable name to use for the relationship. Defaults to 'r"start
- The start variable nameend
- The relationship variable nameFormats a batch UNWIND statement for the given id
batchId
- The batch idFormats a batch FOREACH statement for populating association data
parentVariable
- The parent variableassociation
- The associationFormats a dynamic association query
variable
- The variable to useFormat a reference to the ID for cypher queries
variable
- The name of the variable for the idFormats a match for the ID for this entity
variable
- The IDFormats a match for the ID for this entity
variable
- The IDFormats a match for the ID for this entity
variable
- The IDFormat a match for a node to this entity node
variable
- The name of the variable for the id of the nodeFormat a reference to the ID for cypher queries
variable
- The name of the variable for the idFormat a reference to the ID for cypher queries
variable
- The name of the variable for the id
Get labels specific to the given instance
domainInstance
- The domain instance
return all labels as string usable for cypher, concatenated by ":" @return
recursively join all discriminators up the class hierarchy @return
Reads the id from given Neo4j entity
entity
- The entity