Spring Data Graph

org.springframework.data.graph.neo4j.fieldaccess
Class AbstractNodeRelationshipFieldAccessor<ENTITY extends GraphBacked,STATE,TARGET extends GraphBacked,TSTATE>

java.lang.Object
  extended by org.springframework.data.graph.neo4j.fieldaccess.AbstractNodeRelationshipFieldAccessor<ENTITY,STATE,TARGET,TSTATE>
All Implemented Interfaces:
FieldAccessor<ENTITY>
Direct Known Subclasses:
NodeToNodesRelationshipFieldAccessor, OneToNRelationshipEntityFieldAccessorFactory.OneToNRelationshipEntityFieldAccessor

public abstract class AbstractNodeRelationshipFieldAccessor<ENTITY extends GraphBacked,STATE,TARGET extends GraphBacked,TSTATE>
extends Object
implements FieldAccessor<ENTITY>

Since:
11.09.2010
Author:
Michael Hunger

Field Summary
protected  org.neo4j.graphdb.Direction direction
           
protected  GraphDatabaseContext graphDatabaseContext
           
protected  Class<? extends TARGET> relatedType
           
protected  org.neo4j.graphdb.RelationshipType type
           
 
Constructor Summary
AbstractNodeRelationshipFieldAccessor(Class<? extends TARGET> clazz, GraphDatabaseContext graphDatabaseContext, org.neo4j.graphdb.Direction direction, org.neo4j.graphdb.RelationshipType type)
           
 
Method Summary
protected  void checkNoCircularReference(org.neo4j.graphdb.Node node, Set<STATE> targetNodes)
           
protected  Set<STATE> checkTargetIsSetOfNodebacked(Object newVal)
           
protected  STATE checkUnderlyingNode(ENTITY entity)
           
protected  void createAddedRelationships(STATE node, Set<TSTATE> targetNodes)
           
protected  Set<TARGET> createEntitySetFromRelationshipEndNodes(ENTITY entity)
           
protected  ManagedFieldAccessorSet<ENTITY,TARGET> createManagedSet(ENTITY entity, Set<TARGET> result)
           
protected  void createSingleRelationship(STATE start, TSTATE end)
           
protected abstract  STATE getState(ENTITY entity)
           
protected abstract  Iterable<TSTATE> getStatesFromEntity(ENTITY entity)
           
 boolean isWriteable(ENTITY entity)
           
protected abstract  org.neo4j.graphdb.Relationship obtainSingleRelationship(STATE start, TSTATE end)
           
protected  void removeMissingRelationships(org.neo4j.graphdb.Node node, Set<org.neo4j.graphdb.Node> targetNodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.graph.neo4j.fieldaccess.FieldAccessor
getValue, setValue
 

Field Detail

type

protected final org.neo4j.graphdb.RelationshipType type

direction

protected final org.neo4j.graphdb.Direction direction

relatedType

protected final Class<? extends TARGET extends GraphBacked> relatedType

graphDatabaseContext

protected final GraphDatabaseContext graphDatabaseContext
Constructor Detail

AbstractNodeRelationshipFieldAccessor

public AbstractNodeRelationshipFieldAccessor(Class<? extends TARGET> clazz,
                                             GraphDatabaseContext graphDatabaseContext,
                                             org.neo4j.graphdb.Direction direction,
                                             org.neo4j.graphdb.RelationshipType type)
Method Detail

isWriteable

public boolean isWriteable(ENTITY entity)
Specified by:
isWriteable in interface FieldAccessor<ENTITY extends GraphBacked>
Returns:
false for read only or computed fields, true otherwise

checkUnderlyingNode

protected STATE checkUnderlyingNode(ENTITY entity)

removeMissingRelationships

protected void removeMissingRelationships(org.neo4j.graphdb.Node node,
                                          Set<org.neo4j.graphdb.Node> targetNodes)

createAddedRelationships

protected void createAddedRelationships(STATE node,
                                        Set<TSTATE> targetNodes)

checkNoCircularReference

protected void checkNoCircularReference(org.neo4j.graphdb.Node node,
                                        Set<STATE> targetNodes)

checkTargetIsSetOfNodebacked

protected Set<STATE> checkTargetIsSetOfNodebacked(Object newVal)

createManagedSet

protected ManagedFieldAccessorSet<ENTITY,TARGET> createManagedSet(ENTITY entity,
                                                                  Set<TARGET> result)

createEntitySetFromRelationshipEndNodes

protected Set<TARGET> createEntitySetFromRelationshipEndNodes(ENTITY entity)

createSingleRelationship

protected void createSingleRelationship(STATE start,
                                        TSTATE end)

obtainSingleRelationship

protected abstract org.neo4j.graphdb.Relationship obtainSingleRelationship(STATE start,
                                                                           TSTATE end)

getStatesFromEntity

protected abstract Iterable<TSTATE> getStatesFromEntity(ENTITY entity)

getState

protected abstract STATE getState(ENTITY entity)

Spring Data Graph

Copyright © 2011. All Rights Reserved.