public class PersistentObjectHolder<E> extends RelationshipFault<E> implements ValueHolder<E>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fault |
protected E |
value |
relationshipName, relationshipOwner| Constructor and Description |
|---|
PersistentObjectHolder(Persistent relationshipOwner,
String relationshipName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connect(Persistent persistent)
Returns an object that should be stored as a value in this ValueHolder, ensuring
that it is registered with the same context.
|
E |
getValue()
Returns a value resolving it via a query on the first call to this method.
|
E |
getValueDirectly()
Retrieves ValueHolder value without triggering fault resolution.
|
void |
invalidate()
Turns a ValueHolder into a fault.
|
boolean |
isFault()
Returns true if this holder is not resolved, meaning its object is not yet known.
|
protected void |
mergeLocalChanges(List resolved) |
protected void |
resolve()
Reads an object from the database.
|
E |
setValue(E value)
Sets an object value, marking this ValueHolder as resolved.
|
E |
setValueDirectly(E value)
Sets ValueHolder vaue without triggering fault resolution.
|
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverseprotected boolean fault
protected E value
public PersistentObjectHolder(Persistent relationshipOwner, String relationshipName)
public boolean isFault()
isFault in interface ValueHolder<E>public void invalidate()
ValueHolderinvalidate in interface ValueHolder<E>public E getValue() throws CayenneRuntimeException
getValue in interface ValueHolder<E>CayenneRuntimeExceptionpublic E getValueDirectly() throws CayenneRuntimeException
ValueHoldergetValueDirectly in interface ValueHolder<E>CayenneRuntimeExceptionpublic E setValue(E value) throws CayenneRuntimeException
setValue in interface ValueHolder<E>value - a new value of the ValueHolder.CayenneRuntimeExceptionpublic E setValueDirectly(E value) throws CayenneRuntimeException
ValueHoldersetValueDirectly in interface ValueHolder<E>CayenneRuntimeExceptionprotected void connect(Persistent persistent)
protected void resolve()
protected void mergeLocalChanges(List resolved)
mergeLocalChanges in class RelationshipFault<E>Copyright © 2001–2018 Apache Cayenne. All rights reserved.