org.springframework.data.graph.neo4j.fieldaccess
Class DefaultEntityState<ENTITY extends GraphBacked<STATE>,STATE>
java.lang.Object
org.springframework.data.graph.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
DefaultEntityState
public DefaultEntityState(STATE underlyingState,
ENTITY entity,
Class<? extends ENTITY> type,
DelegatingFieldAccessorFactory delegatingFieldAccessorFactory)
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()
Copyright © 2011. All Rights Reserved.