Spring Data Graph

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

java.lang.Object
  extended by org.springframework.data.neo4j.fieldaccess.DetachedEntityState<ENTITY,STATE>
All Implemented Interfaces:
EntityState<ENTITY,STATE>

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

Since:
15.09.2010
Author:
Michael Hunger

Field Summary
protected  EntityState<ENTITY,STATE> delegate
           
 
Constructor Summary
DetachedEntityState(EntityState<ENTITY,STATE> delegate, GraphDatabaseContext graphDatabaseContext)
           
 
Method Summary
 void createAndAssignState()
          callback for creating and initializing an initial state TODO will be internal implementation detail of persist
 ENTITY getEntity()
           
 GraphDatabaseContext getGraphDatabaseContext()
           
 STATE getPersistentState()
           
 Object getValue(Field field)
           
 boolean hasPersistentState()
           
protected  boolean isDetached()
           
 boolean isWritable(Field field)
           
 ENTITY persist()
           
 void setPersistentState(STATE state)
           
 Object setValue(Field field, Object newVal)
           
protected  boolean transactionIsRunning()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final EntityState<ENTITY extends GraphBacked<STATE>,STATE> delegate
Constructor Detail

DetachedEntityState

public DetachedEntityState(EntityState<ENTITY,STATE> delegate,
                           GraphDatabaseContext graphDatabaseContext)
Method Detail

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

getEntity

public ENTITY getEntity()
Specified by:
getEntity 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>

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

isDetached

protected boolean isDetached()

transactionIsRunning

protected boolean transactionIsRunning()

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

createAndAssignState

public 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>

setPersistentState

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

getGraphDatabaseContext

public GraphDatabaseContext getGraphDatabaseContext()

persist

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

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.