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
public class CollectionContainerPolicy extends InterfaceContainerPolicy
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:
ContainerPolicy,MapContainerPolicy, Serialized Form
-
-
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
Constructors Constructor Description CollectionContainerPolicy()INTERNAL: 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddInto(Object key, Object element, Object container, AbstractSession session)INTERNAL: Add element into a container which implements the Collection interface.ObjectbuildContainerFromVector(Vector vector, AbstractSession session)INTERNAL: Return a container populated with the contents of the specified Vector.voidclear(Object container)INTERNAL: Remove all the elements from container.ObjectcloneFor(Object container)INTERNAL: Return a clone of the specified container.protected booleancontains(Object element, Object container)INTERNAL: Return the true if element exists in container.Class<?>getInterfaceType()booleanhasOrder()INTERNAL: Return whether the collection has order.booleanisCollectionPolicy()booleanisValidContainer(Object container)INTERNAL: Validate the container type.ObjectiteratorFor(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.intsizeFor(Object container)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 Detail
-
CollectionContainerPolicy
public CollectionContainerPolicy()
INTERNAL: Construct a new policy.
-
CollectionContainerPolicy
public CollectionContainerPolicy(Class<?> containerClass)
INTERNAL: Construct a new policy for the specified class.
-
CollectionContainerPolicy
public CollectionContainerPolicy(String containerClassName)
INTERNAL: Construct a new policy for the specified class name.
-
-
Method Detail
-
addInto
public boolean addInto(Object key, Object element, Object container, AbstractSession session)
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
public Object buildContainerFromVector(Vector vector, AbstractSession session)
INTERNAL: Return a container populated with the contents of the specified Vector.- Overrides:
buildContainerFromVectorin classInterfaceContainerPolicy
-
clear
public void clear(Object container)
INTERNAL: Remove all the elements from container.- Specified by:
clearin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
clearin classContainerPolicy- Parameters:
container- java.lang.Object
-
cloneFor
public Object cloneFor(Object container)
INTERNAL: Return a clone of the specified container.- Overrides:
cloneForin classInterfaceContainerPolicy
-
contains
protected boolean contains(Object element, Object container)
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
public Class<?> 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
public boolean isValidContainer(Object container)
INTERNAL: Validate the container type.- Overrides:
isValidContainerin classContainerPolicy- See Also:
isValidContainer(Object),MapContainerPolicy.isValidContainer(Object)
-
isCollectionPolicy
public boolean isCollectionPolicy()
- Overrides:
isCollectionPolicyin classContainerPolicy
-
iteratorFor
public Object iteratorFor(Object container)
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:
ContainerPolicy.hasNext(java.lang.Object),ContainerPolicy.next(java.lang.Object)
-
removeFrom
protected boolean removeFrom(Object key, Object element, Object container)
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
public int sizeFor(Object container)
INTERNAL: Return the size of container.- Specified by:
sizeForin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
sizeForin classContainerPolicy- Returns:
- int The size of the container.
-
-