Spring Data Neo4j

org.springframework.data.neo4j.support.typerepresentation
Class IndexingNodeTypeRepresentationStrategy

java.lang.Object
  extended by org.springframework.data.neo4j.support.typerepresentation.IndexingNodeTypeRepresentationStrategy
All Implemented Interfaces:
NodeTypeRepresentationStrategy, TypeRepresentationStrategy<org.neo4j.graphdb.Node>

public class IndexingNodeTypeRepresentationStrategy
extends Object
implements NodeTypeRepresentationStrategy


Field Summary
static String INDEX_KEY
           
static String INDEX_NAME
           
static String TYPE_PROPERTY_NAME
           
 
Constructor Summary
IndexingNodeTypeRepresentationStrategy(GraphDatabase graphDb)
           
 
Method Summary
 long count(Class<?> entityClass)
           
<U> org.neo4j.helpers.collection.ClosableIterable<org.neo4j.graphdb.Node>
findAll(Class<U> clazz)
           
 Class<?> getJavaType(org.neo4j.graphdb.Node node)
           
 void postEntityCreation(org.neo4j.graphdb.Node state, Class<?> type)
          Callback for setting up and/or storing type information after creation.
 void preEntityRemoval(org.neo4j.graphdb.Node state)
          Callback for cleaning up type information before removal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_NAME

public static final String INDEX_NAME
See Also:
Constant Field Values

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
Constructor Detail

IndexingNodeTypeRepresentationStrategy

public IndexingNodeTypeRepresentationStrategy(GraphDatabase graphDb)
Method Detail

postEntityCreation

public void postEntityCreation(org.neo4j.graphdb.Node state,
                               Class<?> type)
Description copied from interface: TypeRepresentationStrategy
Callback for setting up and/or storing type information after creation.

Specified by:
postEntityCreation in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
Parameters:
state - Backing state of entity being created
type - Type of entity being created

findAll

public <U> org.neo4j.helpers.collection.ClosableIterable<org.neo4j.graphdb.Node> findAll(Class<U> clazz)
Specified by:
findAll in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
Parameters:
clazz - Type whose instances should be iterated over
Returns:
lazy Iterable over all instances of the given type

count

public long count(Class<?> entityClass)
Specified by:
count in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
Returns:
number of instances of this class contained in the graph

getJavaType

public Class<?> getJavaType(org.neo4j.graphdb.Node node)
Specified by:
getJavaType in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node>
Returns:
java type that of the node entity of this node

preEntityRemoval

public void preEntityRemoval(org.neo4j.graphdb.Node 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<org.neo4j.graphdb.Node>
Parameters:
state - Backing state of entity being removed

Spring Data Neo4j

Copyright © 2011 SpringSource. All Rights Reserved.