Spring Data Neo4j

org.springframework.data.neo4j.support.typerepresentation
Class AbstractIndexingTypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>

java.lang.Object
  extended by org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy<S>
All Implemented Interfaces:
TypeRepresentationStrategy<S>
Direct Known Subclasses:
IndexingNodeTypeRepresentationStrategy, IndexingRelationshipTypeRepresentationStrategy

public abstract class AbstractIndexingTypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>
extends Object
implements TypeRepresentationStrategy<S>


Field Summary
protected  GraphDatabase graphDb
           
static String INDEX_KEY
           
protected  String INDEX_NAME
           
protected  IndexProvider indexProvider
           
static String TYPE_PROPERTY_NAME
           
 
Constructor Summary
AbstractIndexingTypeRepresentationStrategy(GraphDatabase graphDb, IndexProvider indexProvider, String indexName, Class<? extends org.neo4j.graphdb.PropertyContainer> clazz)
           
 
Method Summary
protected  void addToTypesIndex(S element, StoredEntityType type)
           
 long count(StoredEntityType type)
           
<U> org.neo4j.helpers.collection.ClosableIterable<S>
findAll(StoredEntityType type)
           
 org.neo4j.graphdb.index.Index<S> getTypesIndex()
           
 void preEntityRemoval(S state)
          Callback for cleaning up type information before removal.
 Object readAliasFrom(S propertyContainer)
           
 void writeTypeTo(S state, StoredEntityType type)
          Callback for setting up and/or storing type information after creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_PROPERTY_NAME

public static final String TYPE_PROPERTY_NAME
See Also:
Constant Field Values

INDEX_KEY

public static final String INDEX_KEY
See Also:
Constant Field Values

INDEX_NAME

protected String INDEX_NAME

graphDb

protected final GraphDatabase graphDb

indexProvider

protected final IndexProvider indexProvider
Constructor Detail

AbstractIndexingTypeRepresentationStrategy

public AbstractIndexingTypeRepresentationStrategy(GraphDatabase graphDb,
                                                  IndexProvider indexProvider,
                                                  String indexName,
                                                  Class<? extends org.neo4j.graphdb.PropertyContainer> clazz)
Method Detail

getTypesIndex

public org.neo4j.graphdb.index.Index<S> getTypesIndex()

writeTypeTo

public void writeTypeTo(S state,
                        StoredEntityType type)
Description copied from interface: TypeRepresentationStrategy
Callback for setting up and/or storing type information after creation.

Specified by:
writeTypeTo in interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>
Parameters:
state - Backing state of entity being created
type - Type of entity being created

count

public long count(StoredEntityType type)
Specified by:
count in interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>

preEntityRemoval

public void preEntityRemoval(S state)
Description copied from interface: TypeRepresentationStrategy
Callback for cleaning up type information before removal. If state does not have any state associated, doesn't do anything.

Specified by:
preEntityRemoval in interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>
Parameters:
state - Backing state of entity being removed

findAll

public <U> org.neo4j.helpers.collection.ClosableIterable<S> findAll(StoredEntityType type)
Specified by:
findAll in interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>

readAliasFrom

public Object readAliasFrom(S propertyContainer)
Specified by:
readAliasFrom in interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>
Returns:
java type that of the node entity of this node

addToTypesIndex

protected void addToTypesIndex(S element,
                               StoredEntityType type)

Spring Data Neo4j

Copyright © 2012 SpringSource. All Rights Reserved.