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, containerClassNameFields 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 TypeMethodDescriptionbooleanaddInto(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.voidINTERNAL: Remove all the elements from container.INTERNAL: Return a clone of the specified container.protected booleanINTERNAL: Return the true if element exists in container.Class<?> booleanhasOrder()INTERNAL: Return whether the collection has order.booleanbooleanisValidContainer(Object container) INTERNAL: Validate the container type.iteratorFor(Object container) INTERNAL: Return an iterator for the given container.protected booleanremoveFrom(Object key, Object element, Object container) INTERNAL: Remove element from container which implements the Collection interface.intINTERNAL: 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, toStringInfoMethods 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:
addIntoin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
addIntoin classContainerPolicy- Returns:
- boolean indicating whether the container changed.
-
buildContainerFromVector
INTERNAL: Return a container populated with the contents of the specified Vector.- Overrides:
buildContainerFromVectorin classInterfaceContainerPolicy
-
clear
INTERNAL: Remove all the elements from container.- Specified by:
clearin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
clearin classContainerPolicy- Parameters:
container- java.lang.Object
-
cloneFor
INTERNAL: Return a clone of the specified container.- Overrides:
cloneForin classInterfaceContainerPolicy
-
contains
INTERNAL: Return the true if element exists in container.- Overrides:
containsin classContainerPolicy- Parameters:
element- java.lang.Objectcontainer- java.lang.Object- Returns:
- boolean true if container 'contains' element
-
getInterfaceType
- Specified by:
getInterfaceTypein classInterfaceContainerPolicy
-
hasOrder
public boolean hasOrder()INTERNAL: Return whether the collection has order. SortedSets cannot be indexed, but they are order-sensitive.- Overrides:
hasOrderin classContainerPolicy
-
isValidContainer
INTERNAL: Validate the container type.- Overrides:
isValidContainerin classContainerPolicy- See Also:
-
isCollectionPolicy
public boolean isCollectionPolicy()- Overrides:
isCollectionPolicyin classContainerPolicy
-
iteratorFor
INTERNAL: Return an iterator for the given container.- Specified by:
iteratorForin interfaceCoreContainerPolicy<AbstractSession>- Specified by:
iteratorForin 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:
removeFromin 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:
sizeForin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
sizeForin classContainerPolicy- Returns:
- int The size of the container.
-