Spring Data Neo4j

org.springframework.data.neo4j.fieldaccess
Class RelatedToFieldAccessor

java.lang.Object
  extended by org.springframework.data.neo4j.fieldaccess.RelatedToFieldAccessor
All Implemented Interfaces:
FieldAccessor
Direct Known Subclasses:
RelatedToCollectionFieldAccessorFactory.RelatedToCollectionFieldAccessor, RelatedToSingleFieldAccessorFactory.RelatedToSingleFieldAccessor

public abstract class RelatedToFieldAccessor
extends Object
implements FieldAccessor

Since:
11.09.2010
Author:
Michael Hunger

Field Summary
protected  org.neo4j.graphdb.Direction direction
           
protected  Neo4jPersistentProperty property
           
protected  Class<?> relatedType
           
protected  RelationshipHelper relationshipHelper
           
protected  Neo4jTemplate template
           
protected  org.neo4j.graphdb.RelationshipType type
           
 
Constructor Summary
RelatedToFieldAccessor(Class<?> relatedType, Neo4jTemplate template, org.neo4j.graphdb.Direction direction, org.neo4j.graphdb.RelationshipType type, Neo4jPersistentProperty property)
           
 
Method Summary
protected  org.neo4j.graphdb.Node checkAndGetNode(Object entity)
           
protected  void createAddedRelationships(org.neo4j.graphdb.Node node, Set<org.neo4j.graphdb.Node> targetNodes)
           
protected  Set<Object> createEntitySetFromRelationshipEndNodes(Object entity, MappingPolicy mappingPolicy)
           
protected
<T> ManagedFieldAccessorSet<T>
createManagedSet(Object entity, Set<T> result, MappingPolicy mappingPolicy)
           
protected  Set<org.neo4j.graphdb.Node> createSetOfTargetNodes(Object newVal)
           
 Object getDefaultValue()
          Returns a default implementation for a field or null if none is provided.
 boolean isWriteable(Object entity)
           
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.neo4j.fieldaccess.FieldAccessor
getValue, setValue
 

Field Detail

type

protected final org.neo4j.graphdb.RelationshipType type

property

protected final Neo4jPersistentProperty property

direction

protected final org.neo4j.graphdb.Direction direction

relatedType

protected final Class<?> relatedType

template

protected final Neo4jTemplate template

relationshipHelper

protected RelationshipHelper relationshipHelper
Constructor Detail

RelatedToFieldAccessor

public RelatedToFieldAccessor(Class<?> relatedType,
                              Neo4jTemplate template,
                              org.neo4j.graphdb.Direction direction,
                              org.neo4j.graphdb.RelationshipType type,
                              Neo4jPersistentProperty property)
Method Detail

isWriteable

public boolean isWriteable(Object entity)
Specified by:
isWriteable in interface FieldAccessor
Returns:
false for read only or computed fields, true otherwise

createManagedSet

protected <T> ManagedFieldAccessorSet<T> createManagedSet(Object entity,
                                                          Set<T> result,
                                                          MappingPolicy mappingPolicy)

getDefaultValue

public Object getDefaultValue()
Description copied from interface: FieldAccessor
Returns a default implementation for a field or null if none is provided.

This default implementation is returned in detached mode by the DetachedEntityState when the value of the field is get.

Specified by:
getDefaultValue in interface FieldAccessor
Returns:
a default implementation for a field or null if none is provided.

checkAndGetNode

protected org.neo4j.graphdb.Node checkAndGetNode(Object entity)

removeMissingRelationships

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

createAddedRelationships

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

createSetOfTargetNodes

protected Set<org.neo4j.graphdb.Node> createSetOfTargetNodes(Object newVal)

createEntitySetFromRelationshipEndNodes

protected Set<Object> createEntitySetFromRelationshipEndNodes(Object entity,
                                                              MappingPolicy mappingPolicy)

Spring Data Neo4j

Copyright © 2012 SpringSource. All Rights Reserved.