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, updateReverse
protected boolean fault
protected Object value
public PersistentObjectHolder(Persistent relationshipOwner, String relationshipName)
public boolean isFault()
isFault
in interface ValueHolder
public void invalidate()
ValueHolder
invalidate
in interface ValueHolder
public Object getValue() throws CayenneRuntimeException
getValue
in interface ValueHolder
CayenneRuntimeException
public Object getValueDirectly() throws CayenneRuntimeException
ValueHolder
getValueDirectly
in interface ValueHolder
CayenneRuntimeException
public Object setValue(Object value) throws CayenneRuntimeException
setValue
in interface ValueHolder
value
- a new value of the ValueHolder.CayenneRuntimeException
public Object setValueDirectly(Object value) throws CayenneRuntimeException
ValueHolder
setValueDirectly
in interface ValueHolder
CayenneRuntimeException
protected Object connect(Persistent persistent)
protected void resolve()
protected void mergeLocalChanges(List resolved)
mergeLocalChanges
in class RelationshipFault
Copyright © 2001–2023 Apache Cayenne. All rights reserved.