public class PersistentObjectHolder extends RelationshipFault implements ValueHolder
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fault |
protected Object |
value |
relationshipName, relationshipOwner| Constructor and Description |
|---|
PersistentObjectHolder(Persistent relationshipOwner,
String relationshipName) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
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.
|
Object |
getValue()
Returns a value resolving it via a query on the first call to this method.
|
Object |
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.
|
Object |
setValue(Object value)
Sets an object value, marking this ValueHolder as resolved.
|
Object |
setValueDirectly(Object value)
Sets ValueHolder vaue without triggering fault resolution.
|
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverseprotected boolean fault
protected Object value
public PersistentObjectHolder(Persistent relationshipOwner, String relationshipName)
public boolean isFault()
isFault in interface ValueHolderpublic void invalidate()
ValueHolderinvalidate in interface ValueHolderpublic Object getValue() throws CayenneRuntimeException
getValue in interface ValueHolderCayenneRuntimeExceptionpublic Object getValueDirectly() throws CayenneRuntimeException
ValueHoldergetValueDirectly in interface ValueHolderCayenneRuntimeExceptionpublic Object setValue(Object value) throws CayenneRuntimeException
setValue in interface ValueHoldervalue - a new value of the ValueHolder.CayenneRuntimeExceptionpublic Object setValueDirectly(Object value) throws CayenneRuntimeException
ValueHoldersetValueDirectly in interface ValueHolderCayenneRuntimeExceptionprotected Object connect(Persistent persistent)
protected void resolve()
protected void mergeLocalChanges(List resolved)
mergeLocalChanges in class RelationshipFaultCopyright © 2001–2023 Apache Cayenne. All rights reserved.