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 boolean
addInto(Object key, Object element, Object container, AbstractSession session)
INTERNAL: Add element into a container which implements the Collection interface.Object
buildContainerFromVector(Vector vector, AbstractSession session)
INTERNAL: Return a container populated with the contents of the specified Vector.void
clear(Object container)
INTERNAL: Remove all the elements from container.Object
cloneFor(Object container)
INTERNAL: Return a clone of the specified container.protected boolean
contains(Object element, Object container)
INTERNAL: Return the true if element exists in container.Class
getInterfaceType()
boolean
hasOrder()
INTERNAL: Return whether the collection has order.boolean
isCollectionPolicy()
boolean
isValidContainer(Object container)
INTERNAL: Validate the container type.Object
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
sizeFor(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:
addInto
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
addInto
in 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:
buildContainerFromVector
in classInterfaceContainerPolicy
-
clear
public void clear(Object container)
INTERNAL: Remove all the elements from container.- Specified by:
clear
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
clear
in classContainerPolicy
- Parameters:
container
- java.lang.Object
-
cloneFor
public Object cloneFor(Object container)
INTERNAL: Return a clone of the specified container.- Overrides:
cloneFor
in classInterfaceContainerPolicy
-
contains
protected boolean contains(Object element, Object container)
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
public Class 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
public boolean isValidContainer(Object container)
INTERNAL: Validate the container type.- Overrides:
isValidContainer
in classContainerPolicy
- See Also:
isValidContainer(Object)
,MapContainerPolicy.isValidContainer(Object)
-
isCollectionPolicy
public boolean isCollectionPolicy()
- Overrides:
isCollectionPolicy
in classContainerPolicy
-
iteratorFor
public Object iteratorFor(Object container)
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:
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:
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
public int sizeFor(Object container)
INTERNAL: Return the size of container.- Specified by:
sizeFor
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
sizeFor
in classContainerPolicy
- Parameters:
container
-- Returns:
- int The size of the container.
-
-