public class PersistentObjectMap extends RelationshipFault implements Map, ValueHolder
| Modifier and Type | Field and Description |
|---|---|
protected Accessor |
mapKeyAccessor |
protected Map |
objectMap |
relationshipName, relationshipOwner| Constructor and Description |
|---|
PersistentObjectMap(Persistent relationshipOwner,
String relationshipName,
Accessor mapKeyAccessor)
Creates PersistentObjectList initializing it with list owner persistent object and
relationship name that this list maps to.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
Object |
get(Object key) |
Object |
getValue()
Returns an object stored by this ValueHolder.
|
Object |
getValueDirectly()
Retrieves ValueHolder value without triggering fault resolution.
|
protected Map |
indexCollection(Collection collection)
Converts a collection into a map indexed by map key.
|
void |
invalidate()
Turns a ValueHolder into a fault.
|
boolean |
isEmpty() |
boolean |
isFault()
Returns true if the internal value is not yet resolved.
|
Set |
keySet() |
protected void |
mergeLocalChanges(List resolved) |
protected void |
postprocessAdd(Collection collection) |
protected void |
postprocessAdd(Object addedObject) |
protected void |
postprocessRemove(Collection collection) |
protected void |
postprocessRemove(Object removedObject) |
Object |
put(Object key,
Object value) |
void |
putAll(Map map) |
void |
putDirectly(Object key,
Object value) |
Object |
remove(Object key) |
void |
removeDirectly(Object key) |
protected Map |
resolvedObjectMap()
Returns internal objects list resolving it if needed.
|
void |
setObjectMap(Map objectMap) |
Object |
setValue(Object value)
Sets an object stored by this ValueHolder.
|
Object |
setValueDirectly(Object value)
Sets ValueHolder vaue without triggering fault resolution.
|
int |
size() |
String |
toString() |
Collection |
values() |
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic PersistentObjectMap(Persistent relationshipOwner, String relationshipName, Accessor mapKeyAccessor)
relationshipOwner - persistent object that owns this list.relationshipName - a query used to resolve the listmapKeyAccessor - an accessor that can read a map key from an object.public Object getValue() throws CayenneRuntimeException
ValueHoldergetValue in interface ValueHolderCayenneRuntimeExceptionpublic Object getValueDirectly() throws CayenneRuntimeException
ValueHoldergetValueDirectly in interface ValueHolderCayenneRuntimeExceptionpublic void invalidate()
ValueHolderinvalidate in interface ValueHolderprotected void mergeLocalChanges(List resolved)
mergeLocalChanges in class RelationshipFaultpublic boolean isFault()
ValueHolderisFault in interface ValueHolderpublic Object setValue(Object value) throws CayenneRuntimeException
ValueHoldersetValue in interface ValueHoldervalue - a new value of the ValueHolder.CayenneRuntimeExceptionpublic Object setValueDirectly(Object value) throws CayenneRuntimeException
ValueHoldersetValueDirectly in interface ValueHolderCayenneRuntimeExceptionpublic void setObjectMap(Map objectMap)
protected Map resolvedObjectMap()
protected Map indexCollection(Collection collection)
protected void postprocessAdd(Object addedObject)
protected void postprocessAdd(Collection collection)
protected void postprocessRemove(Object removedObject)
protected void postprocessRemove(Collection collection)
public boolean containsKey(Object key)
containsKey in interface Mappublic boolean containsValue(Object value)
containsValue in interface Mappublic Collection values()
public void removeDirectly(Object key)
Copyright © 2001–2018 Apache Cayenne. All rights reserved.