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, updateReverse
public 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
ValueHolder
getValue
in interface ValueHolder
CayenneRuntimeException
public Object getValueDirectly() throws CayenneRuntimeException
ValueHolder
getValueDirectly
in interface ValueHolder
CayenneRuntimeException
public void invalidate()
ValueHolder
invalidate
in interface ValueHolder
protected void mergeLocalChanges(List resolved)
mergeLocalChanges
in class RelationshipFault
public boolean isFault()
ValueHolder
isFault
in interface ValueHolder
public Object setValue(Object value) throws CayenneRuntimeException
ValueHolder
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
public 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 Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Collection values()
public void removeDirectly(Object key)
Copyright © 2001–2015 Apache Cayenne. All rights reserved.