Spring Data Graph

org.springframework.data.graph.core
Interface NodeTypeStrategy

All Known Implementing Classes:
SubReferenceNodeTypeStrategy

public interface NodeTypeStrategy

Strategy to handle representation of java types in the graph. Possible implementation are type/class nodes (forming an inheritance chain) that is linked to from the instance and keeps a count of the instances. Another approach could use indexing and a type property on the instance fields. Contains a callback on entity creation that can setup the type representation. The finder methods are delegated to for the appropriate calls for the strategy set for the datastore.

Since:
13.09.2010
Author:
Michael Hunger

Method Summary
<T extends NodeBacked>
Class<T>
confirmType(org.neo4j.graphdb.Node node, Class<T> type)
           
 long count(Class<? extends NodeBacked> entityClass)
           
<T extends NodeBacked>
Iterable<T>
findAll(Class<T> clazz)
           
<T extends NodeBacked>
Class<T>
getJavaType(org.neo4j.graphdb.Node node)
           
 void postEntityCreation(NodeBacked entity)
          callback on entity creation for setting up type representation
 void preEntityRemoval(NodeBacked entity)
          callback for lifecycle management before node entity removal
 

Method Detail

postEntityCreation

void postEntityCreation(NodeBacked entity)
callback on entity creation for setting up type representation

Parameters:
entity -

findAll

<T extends NodeBacked> Iterable<T> findAll(Class<T> clazz)
Type Parameters:
T - Type parameter for generified return value
Parameters:
clazz - Type whose instances should be iterated over
Returns:
lazy Iterable over all instances of the given type

count

long count(Class<? extends NodeBacked> entityClass)
Parameters:
entityClass -
Returns:
number of instances of this class contained in the graph

getJavaType

<T extends NodeBacked> Class<T> getJavaType(org.neo4j.graphdb.Node node)
Type Parameters:
T -
Parameters:
node -
Returns:
java type that of the node entity of this node

preEntityRemoval

void preEntityRemoval(NodeBacked entity)
callback for lifecycle management before node entity removal

Parameters:
entity -

confirmType

<T extends NodeBacked> Class<T> confirmType(org.neo4j.graphdb.Node node,
                                            Class<T> type)

Spring Data Graph

Copyright © 2011. All Rights Reserved.