Module org.eclipse.persistence.core
Class CollectionContainerPolicy
java.lang.Object
org.eclipse.persistence.internal.queries.ContainerPolicy
org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
org.eclipse.persistence.internal.queries.CollectionContainerPolicy
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreContainerPolicy<AbstractSession>
- Direct Known Subclasses:
ListContainerPolicy
,SortedCollectionContainerPolicy
Purpose: A CollectionContainerPolicy is ContainerPolicy whose container class implements the Collection interface.
Responsibilities: Provide the functionality to operate on an instance of a Collection.
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
cloneMethod, containerClass, containerClassName
Fields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor
-
Constructor Summary
ConstructorsConstructorDescriptionINTERNAL: Construct a new policy.CollectionContainerPolicy
(Class<?> containerClass) INTERNAL: Construct a new policy for the specified class.CollectionContainerPolicy
(String containerClassName) INTERNAL: Construct a new policy for the specified class name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addInto
(Object key, Object element, Object container, AbstractSession session) INTERNAL: Add element into a container which implements the Collection interface.buildContainerFromVector
(Vector vector, AbstractSession session) INTERNAL: Return a container populated with the contents of the specified Vector.void
INTERNAL: Remove all the elements from container.INTERNAL: Return a clone of the specified container.protected boolean
INTERNAL: Return the true if element exists in container.Class
<?> boolean
hasOrder()
INTERNAL: Return whether the collection has order.boolean
boolean
isValidContainer
(Object container) INTERNAL: Validate the container type.iteratorFor
(Object container) INTERNAL: Return an iterator for the given container.protected boolean
removeFrom
(Object key, Object element, Object container) INTERNAL: Remove element from container which implements the Collection interface.int
INTERNAL: Return the size of container.Methods inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
convertClassNamesToClasses, createChangeEvent, createQueryKeyForMapKey, equals, getCloneMethod, getCloneMethod, getContainerClass, getContainerClassName, getDirectKeyField, hashCode, hasNext, invokeCloneMethodOn, isMapKeyAttribute, isValidContainerType, next, setCloneMethod, setContainerClass, setContainerClassName, toStringInfo
Methods inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
addAdditionalFieldsToQuery, addAll, addAll, addFieldsForMapKey, addInto, addInto, addInto, addNestedJoinsQueriesForMapKey, addNextValueFromIteratorInto, buildChangeSetForNewObjectInCollection, buildCloneForKey, buildCollectionEntry, buildDefaultPolicy, buildKey, buildKeyFromJoinedRow, buildPolicyFor, buildPolicyFor, buildReferencesPKList, buildSelectionQueryForDirectCollectionMapping, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, clone, collectObjectForNewCollection, compareCollectionsForChange, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, copyMapDataToRow, createChangeSetForKeys, createWrappedObjectFromExistingWrappedObject, deleteWrappedObject, execute, getAdditionalFieldsForJoin, getAdditionalTablesForJoinQuery, getChangeValuesFrom, getCloneDataFromChangeSet, getConstructor, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, getKeyType, hasElementDescriptor, initialize, initializeConstructor, isCursoredStreamPolicy, isCursorPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapKeyObject, isMappedKeyMapPolicy, isMapPolicy, isOrderedListPolicy, isScrollableCursorPolicy, iterateOnMapKey, keyFrom, keyFromEntry, keyFromIterator, mergeCascadeParts, mergeChanges, mergeChanges, next, nextEntry, nextEntry, overridesRead, postCalculateChanges, postCalculateChanges, postInitialize, prepare, prepareForExecution, processAdditionalWritableMapKeyFields, propagatesEventsToCollection, propogatePostDelete, propogatePostInsert, propogatePostUpdate, propogatePreDelete, propogatePreInsert, propogatePreUpdate, recordAddToCollectionInChangeRecord, recordPrivateOwnedRemovals, recordRemoveFromCollectionInChangeRecord, recordUpdateToCollectionInChangeRecord, remoteExecute, removeFrom, removeFrom, requiresDataModificationEvents, setConstructor, setDefaultContainerClass, setElementDescriptor, setKeyName, setKeyName, shouldAddAll, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, toString, unwrapElement, unwrapIteratorResult, updateChangeRecordForSelfMerge, updateJoinedMappingIndexesForMapKey, valueFromPKList, vectorFor
-
Constructor Details
-
CollectionContainerPolicy
public CollectionContainerPolicy()INTERNAL: Construct a new policy. -
CollectionContainerPolicy
INTERNAL: Construct a new policy for the specified class. -
CollectionContainerPolicy
INTERNAL: Construct a new policy for the specified class name.
-
-
Method Details
-
addInto
INTERNAL: Add element into a container which implements the Collection interface.- Specified by:
addInto
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
addInto
in classContainerPolicy
- Returns:
- boolean indicating whether the container changed.
-
buildContainerFromVector
INTERNAL: Return a container populated with the contents of the specified Vector.- Overrides:
buildContainerFromVector
in classInterfaceContainerPolicy
-
clear
INTERNAL: Remove all the elements from container.- Specified by:
clear
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
clear
in classContainerPolicy
- Parameters:
container
- java.lang.Object
-
cloneFor
INTERNAL: Return a clone of the specified container.- Overrides:
cloneFor
in classInterfaceContainerPolicy
-
contains
INTERNAL: Return the true if element exists in container.- Overrides:
contains
in classContainerPolicy
- Parameters:
element
- java.lang.Objectcontainer
- java.lang.Object- Returns:
- boolean true if container 'contains' element
-
getInterfaceType
- Specified by:
getInterfaceType
in classInterfaceContainerPolicy
-
hasOrder
public boolean hasOrder()INTERNAL: Return whether the collection has order. SortedSets cannot be indexed, but they are order-sensitive.- Overrides:
hasOrder
in classContainerPolicy
-
isValidContainer
INTERNAL: Validate the container type.- Overrides:
isValidContainer
in classContainerPolicy
- See Also:
-
isCollectionPolicy
public boolean isCollectionPolicy()- Overrides:
isCollectionPolicy
in classContainerPolicy
-
iteratorFor
INTERNAL: Return an iterator for the given container.- Specified by:
iteratorFor
in interfaceCoreContainerPolicy<AbstractSession>
- Specified by:
iteratorFor
in classContainerPolicy
- Parameters:
container
- java.lang.Object- Returns:
- java.util.Enumeration/java.util.Iterator
- See Also:
-
removeFrom
INTERNAL: Remove element from container which implements the Collection interface.- Overrides:
removeFrom
in classContainerPolicy
- Parameters:
key
- java.lang.Object This param represents the key that would be used by this object in a map, may be nullelement
- java.lang.Objectcontainer
- java.lang.Object
-
sizeFor
INTERNAL: Return the size of container.- Specified by:
sizeFor
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
sizeFor
in classContainerPolicy
- Returns:
- int The size of the container.
-