public class SubReferenceNodeTypeRepresentationStrategy extends Object implements NodeTypeRepresentationStrategy
TypeRepresentationStrategy
that uses a hierarchy of reference nodes to represent the java type of the entity in the
graph database. Entity nodes are related to their concrete type via an INSTANCE_OF relationship, the type hierarchy is
related to supertypes via SUBCLASS_OF relationships. Each concrete subreference node keeps a count property with the number of
instances of this class in the graph.Modifier and Type | Field and Description |
---|---|
static org.neo4j.graphdb.RelationshipType |
INSTANCE_OF_RELATIONSHIP_TYPE |
static org.neo4j.graphdb.RelationshipType |
SUBCLASS_OF_RELATIONSHIP_TYPE |
static String |
SUBREF_CLASS_KEY |
static String |
SUBREF_PREFIX |
static String |
SUBREFERENCE_NODE_COUNTER_KEY |
Constructor and Description |
---|
SubReferenceNodeTypeRepresentationStrategy(GraphDatabase graphDatabase) |
Modifier and Type | Method and Description |
---|---|
static void |
acquireWriteLock(org.neo4j.graphdb.PropertyContainer entity) |
long |
count(StoredEntityType type) |
static Integer |
decrementAndGetCounter(org.neo4j.graphdb.Node node,
String propertyKey,
int notLowerThan) |
<T> org.neo4j.helpers.collection.ClosableIterable<org.neo4j.graphdb.Node> |
findAll(StoredEntityType type) |
org.neo4j.graphdb.Node |
findSubreferenceNode(Object alias) |
org.neo4j.graphdb.Node |
findSubreferenceNode(StoredEntityType type) |
org.neo4j.graphdb.Node |
getOrCreateSubReferenceNode(org.neo4j.graphdb.RelationshipType relType) |
static org.neo4j.graphdb.Node |
getSingleOtherNode(org.neo4j.graphdb.Node node,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction) |
static Integer |
incrementAndGetCounter(org.neo4j.graphdb.Node node,
String propertyKey) |
boolean |
isLabelBased() |
static boolean |
isStrategyAlreadyInUse(GraphDatabase graphDatabaseService) |
org.neo4j.graphdb.Node |
obtainSubreferenceNode(Object alias) |
org.neo4j.graphdb.Node |
obtainSubreferenceNode(StoredEntityType type) |
void |
preEntityRemoval(org.neo4j.graphdb.Node state)
Callback for cleaning up type information before removal.
|
Object |
readAliasFrom(org.neo4j.graphdb.Node node) |
void |
writeTypeTo(org.neo4j.graphdb.Node state,
StoredEntityType type)
Callback for setting up and/or storing type information after creation.
|
public static final org.neo4j.graphdb.RelationshipType INSTANCE_OF_RELATIONSHIP_TYPE
public static final org.neo4j.graphdb.RelationshipType SUBCLASS_OF_RELATIONSHIP_TYPE
public static final String SUBREFERENCE_NODE_COUNTER_KEY
public static final String SUBREF_PREFIX
public static final String SUBREF_CLASS_KEY
public SubReferenceNodeTypeRepresentationStrategy(GraphDatabase graphDatabase)
public static org.neo4j.graphdb.Node getSingleOtherNode(org.neo4j.graphdb.Node node, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction)
public static Integer incrementAndGetCounter(org.neo4j.graphdb.Node node, String propertyKey)
public static Integer decrementAndGetCounter(org.neo4j.graphdb.Node node, String propertyKey, int notLowerThan)
public static void acquireWriteLock(org.neo4j.graphdb.PropertyContainer entity)
public static boolean isStrategyAlreadyInUse(GraphDatabase graphDatabaseService)
public void writeTypeTo(org.neo4j.graphdb.Node state, StoredEntityType type)
TypeRepresentationStrategy
writeTypeTo
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
state
- Backing state of entity being createdtype
- Type of entity being createdpublic long count(StoredEntityType type)
count
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
public Object readAliasFrom(org.neo4j.graphdb.Node node)
readAliasFrom
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
public void preEntityRemoval(org.neo4j.graphdb.Node state)
TypeRepresentationStrategy
preEntityRemoval
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
state
- Backing state of entity being removedpublic boolean isLabelBased()
isLabelBased
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
public <T> org.neo4j.helpers.collection.ClosableIterable<org.neo4j.graphdb.Node> findAll(StoredEntityType type)
findAll
in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
public org.neo4j.graphdb.Node obtainSubreferenceNode(StoredEntityType type)
public org.neo4j.graphdb.Node obtainSubreferenceNode(Object alias)
public org.neo4j.graphdb.Node findSubreferenceNode(StoredEntityType type)
public org.neo4j.graphdb.Node findSubreferenceNode(Object alias)
public org.neo4j.graphdb.Node getOrCreateSubReferenceNode(org.neo4j.graphdb.RelationshipType relType)
Copyright © 2011-2015–2015 Pivotal Software, Inc.. All rights reserved.