Spring Data Graph

org.springframework.data.neo4j.fieldaccess
Class DefaultEntityState<ENTITY extends GraphBacked<STATE>,STATE>

java.lang.Object
  extended by org.springframework.data.neo4j.fieldaccess.DefaultEntityState<ENTITY,STATE>
All Implemented Interfaces:
EntityState<ENTITY,STATE>
Direct Known Subclasses:
NodeEntityState, PartialNodeEntityState, RelationshipEntityState

public abstract class DefaultEntityState<ENTITY extends GraphBacked<STATE>,STATE>
extends Object
implements EntityState<ENTITY,STATE>

Since:
12.09.2010
Author:
Michael Hunger

Field Summary
protected  ENTITY entity
           
protected static org.apache.commons.logging.Log log
           
protected  Class<? extends ENTITY> type
           
 
Constructor Summary
DefaultEntityState(STATE underlyingState, ENTITY entity, Class<? extends ENTITY> type, DelegatingFieldAccessorFactory delegatingFieldAccessorFactory)
           
 
Method Summary
protected  FieldAccessor<ENTITY> accessorFor(Field field)
           
abstract  void createAndAssignState()
          callback for creating and initializing an initial state TODO will be internal implementation detail of persist
 ENTITY getEntity()
           
protected  Object getIdFromEntity()
           
 STATE getPersistentState()
           
 Object getValue(Field field)
           
 boolean hasPersistentState()
           
 boolean isWritable(Field field)
           
 void setPersistentState(STATE state)
           
 Object setValue(Field field, Object newVal)
           
 
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.core.EntityState
persist
 

Field Detail

entity

protected final ENTITY extends GraphBacked<STATE> entity

type

protected final Class<? extends ENTITY extends GraphBacked<STATE>> type

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

DefaultEntityState

public DefaultEntityState(STATE underlyingState,
                          ENTITY entity,
                          Class<? extends ENTITY> type,
                          DelegatingFieldAccessorFactory delegatingFieldAccessorFactory)
Method Detail

createAndAssignState

public abstract void createAndAssignState()
Description copied from interface: EntityState
callback for creating and initializing an initial state TODO will be internal implementation detail of persist

Specified by:
createAndAssignState in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>

getEntity

public ENTITY getEntity()
Specified by:
getEntity in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>

setPersistentState

public void setPersistentState(STATE state)
Specified by:
setPersistentState in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>

hasPersistentState

public boolean hasPersistentState()
Specified by:
hasPersistentState in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>

getPersistentState

public STATE getPersistentState()
Specified by:
getPersistentState in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>

isWritable

public boolean isWritable(Field field)
Specified by:
isWritable in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>
Returns:
true if the field can be written

getValue

public Object getValue(Field field)
Specified by:
getValue in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>
Returns:
value of the field either from the state and/or the entity

setValue

public Object setValue(Field field,
                       Object newVal)
Specified by:
setValue in interface EntityState<ENTITY extends GraphBacked<STATE>,STATE>
Returns:
sets the value in the entity and/or the state

accessorFor

protected FieldAccessor<ENTITY> accessorFor(Field field)

getIdFromEntity

protected Object getIdFromEntity()

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.