|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.util.RelationshipFault
org.apache.cayenne.util.PersistentObjectHolder
public class PersistentObjectHolder
A ValueHolder implementation that holds a single Persistent object related to an object used to initialize PersistentObjectHolder. Value is resolved on first access.
| Field Summary | |
|---|---|
protected boolean |
fault
|
protected Object |
value
|
| Fields inherited from class org.apache.cayenne.util.RelationshipFault |
|---|
relationshipName, relationshipOwner |
| Constructor Summary | |
|---|---|
PersistentObjectHolder(Persistent relationshipOwner,
String relationshipName)
|
|
| Method Summary | |
|---|---|
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 |
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. |
| Methods inherited from class org.apache.cayenne.util.RelationshipFault |
|---|
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean fault
protected Object value
| Constructor Detail |
|---|
public PersistentObjectHolder(Persistent relationshipOwner,
String relationshipName)
| Method Detail |
|---|
public boolean isFault()
isFault in interface ValueHolderpublic void invalidate()
ValueHolder
invalidate in interface ValueHolder
public Object getValue()
throws CayenneRuntimeException
getValue in interface ValueHolderCayenneRuntimeException
public Object getValueDirectly()
throws CayenneRuntimeException
ValueHolder
getValueDirectly in interface ValueHolderCayenneRuntimeException
public Object setValue(Object value)
throws CayenneRuntimeException
setValue in interface ValueHoldervalue - a new value of the ValueHolder.
CayenneRuntimeException
public Object setValueDirectly(Object value)
throws CayenneRuntimeException
ValueHolder
setValueDirectly in interface ValueHolderCayenneRuntimeExceptionprotected Object connect(Persistent persistent)
protected void resolve()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||