Spring Data Neo4j

org.springframework.data.neo4j.core
Interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>

All Known Subinterfaces:
NodeTypeRepresentationStrategy, RelationshipTypeRepresentationStrategy
All Known Implementing Classes:
AbstractIndexingTypeRepresentationStrategy, IndexingNodeTypeRepresentationStrategy, IndexingRelationshipTypeRepresentationStrategy, NoopNodeTypeRepresentationStrategy, NoopRelationshipTypeRepresentationStrategy, SubReferenceNodeTypeRepresentationStrategy, TypeRepresentationStrategies

public interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer>

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 set up the type representation. The finder methods are delegated to the appropriate calls for the strategy set for the datastore. TODO use SDC TypeMapper implementations to delegate to for concrete implementation

Since:
13.09.2010
Author:
Michael Hunger

Method Summary
 long count(StoredEntityType type)
           
<U> org.neo4j.helpers.collection.ClosableIterable<S>
findAll(StoredEntityType type)
           
 void preEntityRemoval(S state)
          Callback for cleaning up type information before removal.
 Object readAliasFrom(S state)
           
 void writeTypeTo(S state, StoredEntityType type)
          Callback for setting up and/or storing type information after creation.
 

Method Detail

writeTypeTo

void writeTypeTo(S state,
                 StoredEntityType type)
Callback for setting up and/or storing type information after creation.

Parameters:
state - Backing state of entity being created
type - Type of entity being created

findAll

<U> org.neo4j.helpers.collection.ClosableIterable<S> findAll(StoredEntityType type)
Parameters:
type -
Returns:
lazy Iterable over all instances of the given type

count

long count(StoredEntityType type)
Parameters:
type -
Returns:
number of instances of this class contained in the graph

readAliasFrom

Object readAliasFrom(S state)
Returns:
java type that of the node entity of this node

preEntityRemoval

void preEntityRemoval(S state)
Callback for cleaning up type information before removal. If state does not have any state associated, doesn't do anything.

Parameters:
state - Backing state of entity being removed

Spring Data Neo4j

Copyright © 2013 SpringSource. All Rights Reserved.