Package org.apache.cayenne.util
Class PersistentObjectMap
java.lang.Object
org.apache.cayenne.util.RelationshipFault
org.apache.cayenne.util.PersistentObjectMap
- All Implemented Interfaces:
- Serializable,- Map,- ValueHolder
- Since:
- 3.0
- See Also:
- 
Nested Class Summary
- 
Field SummaryFieldsFields inherited from class org.apache.cayenne.util.RelationshipFaultrelationshipName, relationshipOwner
- 
Constructor SummaryConstructorsConstructorDescriptionPersistentObjectMap(Persistent relationshipOwner, String relationshipName, Accessor mapKeyAccessor) Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()getValue()Returns an object stored by this ValueHolder.Retrieves ValueHolder value without triggering fault resolution.protected MapindexCollection(Collection<Object> collection) Converts a collection into a map indexed by map key.voidTurns a ValueHolder into a fault.booleanisEmpty()booleanisFault()Returns true if the internal value is not yet resolved.keySet()protected voidmergeLocalChanges(List resolved) protected voidpostprocessAdd(Object addedObject) protected voidpostprocessAdd(Collection collection) protected voidpostprocessRemove(Object removedObject) protected voidpostprocessRemove(Collection collection) voidvoidputDirectly(Object key, Object value) voidremoveDirectly(Object key) protected MapReturns internal objects list resolving it if needed.voidsetObjectMap(Map objectMap) Sets an object stored by this ValueHolder.setValueDirectly(Object value) Sets ValueHolder vaue without triggering fault resolution.intsize()toString()values()Methods inherited from class org.apache.cayenne.util.RelationshipFaultgetRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverseMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Field Details- 
objectMap
- 
mapKeyAccessor
 
- 
- 
Constructor Details- 
PersistentObjectMappublic PersistentObjectMap(Persistent relationshipOwner, String relationshipName, Accessor mapKeyAccessor) Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.- Parameters:
- relationshipOwner- persistent object that owns this list.
- relationshipName- a query used to resolve the list
- mapKeyAccessor- an accessor that can read a map key from an object.
 
 
- 
- 
Method Details- 
getValueDescription copied from interface:ValueHolderReturns an object stored by this ValueHolder.- Specified by:
- getValuein interface- ValueHolder
- Throws:
- CayenneRuntimeException
 
- 
getValueDirectlyDescription copied from interface:ValueHolderRetrieves ValueHolder value without triggering fault resolution.- Specified by:
- getValueDirectlyin interface- ValueHolder
- Throws:
- CayenneRuntimeException
 
- 
invalidatepublic void invalidate()Description copied from interface:ValueHolderTurns a ValueHolder into a fault.- Specified by:
- invalidatein interface- ValueHolder
 
- 
mergeLocalChanges- Specified by:
- mergeLocalChangesin class- RelationshipFault
 
- 
isFaultpublic boolean isFault()Description copied from interface:ValueHolderReturns true if the internal value is not yet resolved.- Specified by:
- isFaultin interface- ValueHolder
 
- 
setValueDescription copied from interface:ValueHolderSets an object stored by this ValueHolder.- Specified by:
- setValuein interface- ValueHolder
- Parameters:
- value- a new value of the ValueHolder.
- Returns:
- a previous value saved in the ValueHolder.
- Throws:
- CayenneRuntimeException
 
- 
setValueDirectlyDescription copied from interface:ValueHolderSets ValueHolder vaue without triggering fault resolution.- Specified by:
- setValueDirectlyin interface- ValueHolder
- Throws:
- CayenneRuntimeException
 
- 
setObjectMap
- 
resolvedObjectMapReturns internal objects list resolving it if needed.
- 
indexCollectionConverts a collection into a map indexed by map key.
- 
toString
- 
postprocessAdd
- 
postprocessAdd
- 
postprocessRemove
- 
postprocessRemove
- 
clearpublic void clear()
- 
containsKey- Specified by:
- containsKeyin interface- Map
 
- 
containsValue- Specified by:
- containsValuein interface- Map
 
- 
entrySet
- 
get
- 
isEmptypublic boolean isEmpty()
- 
keySet
- 
put
- 
putAll
- 
remove
- 
sizepublic int size()
- 
values
- 
putDirectly
- 
removeDirectly
 
-