Class InterfaceContainerPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ContainerPolicy
-
- org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CoreContainerPolicy<AbstractSession>
- Direct Known Subclasses:
CollectionContainerPolicy,MapContainerPolicy
public abstract class InterfaceContainerPolicy extends ContainerPolicy
Purpose: The abstract class for ContainerPolicy's whose container class implements a container interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.MethodcloneMethodThe method which will return a clone of an instance of the containerClass.protected java.lang.ClasscontainerClassThe concrete container class.protected java.lang.StringcontainerClassName-
Fields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor
-
-
Constructor Summary
Constructors Constructor Description InterfaceContainerPolicy()INTERNAL: Construct a new policy.InterfaceContainerPolicy(java.lang.Class containerClass)INTERNAL: Construct a new policy for the specified class.InterfaceContainerPolicy(java.lang.String containerClassName)INTERNAL: Construct a new policy for the specified class name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectbuildContainerFromVector(java.util.Vector vector, AbstractSession session)INTERNAL: Return a container populated with the contents of the specified Vector.java.lang.ObjectcloneFor(java.lang.Object container)INTERNAL: Return a clone of the specified container.voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings.CollectionChangeEventcreateChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)INTERNAL: Creates a CollectionChangeEvent for the containerQueryKeycreateQueryKeyForMapKey()INTERNAL: Create a query key that links to the map key InterfaceContainerPolicy does not support maps, so this method will return null subclasses will extend this method.booleanequals(java.lang.Object object)INTERNAL: Return if the policy is equal to the other.java.lang.reflect.MethodgetCloneMethod()INTERNAL: Return the 'clone()' Method for the container class.protected java.lang.reflect.MethodgetCloneMethod(java.lang.Class javaClass)INTERNAL: Return the 'clone()' Method for the specified class.java.lang.ClassgetContainerClass()INTERNAL: Returns the container class to be used with this policy.java.lang.StringgetContainerClassName()INTERNAL: Used by the MWDatabaseFieldgetDirectKeyField(CollectionMapping mapping)INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping.abstract java.lang.ClassgetInterfaceType()inthashCode()booleanhasNext(java.lang.Object iterator)INTERNAL: Return whether the iterator has more objects,protected java.lang.ObjectinvokeCloneMethodOn(java.lang.reflect.Method method, java.lang.Object container)INTERNAL: Invoke the specified clone method on the container, handling the necessary exceptions.booleanisMapKeyAttribute()INTERNAL: Return whether a map key this container policy represents is an attribute By default this method will return false since only subclasses actually represent maps.booleanisValidContainerType(java.lang.Class containerType)INTERNAL: Validate the container type.protected java.lang.Objectnext(java.lang.Object iterator)INTERNAL: Return the next object on the queue.voidsetCloneMethod(java.lang.reflect.Method cloneMethod)INTERNAL: Set the Method that will return a clone of an instance of the containerClass.voidsetContainerClass(java.lang.Class containerClass)INTERNAL: Set the class to use as the container.voidsetContainerClassName(java.lang.String containerClassName)INTERNAL: Used by the MWprotected java.lang.ObjecttoStringInfo()-
Methods inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
addAdditionalFieldsToQuery, addAll, addAll, addFieldsForMapKey, addInto, addInto, addInto, addInto, addNestedJoinsQueriesForMapKey, addNextValueFromIteratorInto, buildChangeSetForNewObjectInCollection, buildCloneForKey, buildCollectionEntry, buildDefaultPolicy, buildKey, buildKeyFromJoinedRow, buildPolicyFor, buildPolicyFor, buildReferencesPKList, buildSelectionQueryForDirectCollectionMapping, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clear, clone, clone, collectObjectForNewCollection, compareCollectionsForChange, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, contains, copyMapDataToRow, createChangeSetForKeys, createWrappedObjectFromExistingWrappedObject, deleteWrappedObject, execute, getAdditionalFieldsForJoin, getAdditionalTablesForJoinQuery, getChangeValuesFrom, getCloneDataFromChangeSet, getConstructor, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, getKeyType, hasElementDescriptor, hasOrder, initialize, initializeConstructor, isCollectionPolicy, isCursoredStreamPolicy, isCursorPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapKeyObject, isMappedKeyMapPolicy, isMapPolicy, isOrderedListPolicy, isScrollableCursorPolicy, isValidContainer, iterateOnMapKey, iteratorFor, 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, removeFrom, requiresDataModificationEvents, setConstructor, setDefaultContainerClass, setElementDescriptor, setKeyName, setKeyName, shouldAddAll, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, sizeFor, toString, unwrapElement, unwrapIteratorResult, updateChangeRecordForSelfMerge, updateJoinedMappingIndexesForMapKey, valueFromPKList, vectorFor
-
-
-
-
Field Detail
-
containerClass
protected java.lang.Class containerClass
The concrete container class.
-
containerClassName
protected java.lang.String containerClassName
-
cloneMethod
protected transient java.lang.reflect.Method cloneMethod
The method which will return a clone of an instance of the containerClass.
-
-
Constructor Detail
-
InterfaceContainerPolicy
public InterfaceContainerPolicy()
INTERNAL: Construct a new policy.
-
InterfaceContainerPolicy
public InterfaceContainerPolicy(java.lang.Class containerClass)
INTERNAL: Construct a new policy for the specified class.
-
InterfaceContainerPolicy
public InterfaceContainerPolicy(java.lang.String containerClassName)
INTERNAL: Construct a new policy for the specified class name.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
INTERNAL: Return if the policy is equal to the other. By default if they are the same class, they are considered equal. This is used for query parse caching.- Overrides:
equalsin classContainerPolicy
-
hashCode
public int hashCode()
- Overrides:
hashCodein classContainerPolicy
-
cloneFor
public java.lang.Object cloneFor(java.lang.Object container)
INTERNAL: Return a clone of the specified container.- Overrides:
cloneForin classContainerPolicy
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Overrides:
convertClassNamesToClassesin classContainerPolicy- Parameters:
classLoader-
-
createChangeEvent
public CollectionChangeEvent createChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)
INTERNAL: Creates a CollectionChangeEvent for the container- Specified by:
createChangeEventin classContainerPolicy
-
createQueryKeyForMapKey
public QueryKey createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key InterfaceContainerPolicy does not support maps, so this method will return null subclasses will extend this method.
-
getCloneMethod
public java.lang.reflect.Method getCloneMethod()
INTERNAL: Return the 'clone()' Method for the container class. Lazy initialization is used, so we can serialize these things.
-
getCloneMethod
protected java.lang.reflect.Method getCloneMethod(java.lang.Class javaClass)
INTERNAL: Return the 'clone()' Method for the specified class. Return null if the method does not exist anywhere in the hierarchy
-
getContainerClass
public java.lang.Class getContainerClass()
INTERNAL: Returns the container class to be used with this policy.- Overrides:
getContainerClassin classContainerPolicy
-
getContainerClassName
public java.lang.String getContainerClassName()
Description copied from class:ContainerPolicyINTERNAL: Used by the MW- Overrides:
getContainerClassNamein classContainerPolicy
-
getDirectKeyField
public DatabaseField getDirectKeyField(CollectionMapping mapping)
INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping. If the keyMapping is not a DirectMapping, this will return null.
-
getInterfaceType
public abstract java.lang.Class getInterfaceType()
-
hasNext
public boolean hasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects,- Specified by:
hasNextin interfaceCoreContainerPolicy<AbstractSession>- Specified by:
hasNextin classContainerPolicy- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
invokeCloneMethodOn
protected java.lang.Object invokeCloneMethodOn(java.lang.reflect.Method method, java.lang.Object container)INTERNAL: Invoke the specified clone method on the container, handling the necessary exceptions.
-
isMapKeyAttribute
public boolean isMapKeyAttribute()
INTERNAL: Return whether a map key this container policy represents is an attribute By default this method will return false since only subclasses actually represent maps.
-
isValidContainerType
public boolean isValidContainerType(java.lang.Class containerType)
INTERNAL: Validate the container type.- Overrides:
isValidContainerTypein classContainerPolicy
-
next
protected java.lang.Object next(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. Valid for some subclasses only.- Specified by:
nextin classContainerPolicy- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
setCloneMethod
public void setCloneMethod(java.lang.reflect.Method cloneMethod)
INTERNAL: Set the Method that will return a clone of an instance of the containerClass.
-
setContainerClass
public void setContainerClass(java.lang.Class containerClass)
INTERNAL: Set the class to use as the container.- Specified by:
setContainerClassin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
setContainerClassin classContainerPolicy
-
setContainerClassName
public void setContainerClassName(java.lang.String containerClassName)
Description copied from class:ContainerPolicyINTERNAL: Used by the MW- Overrides:
setContainerClassNamein classContainerPolicy
-
buildContainerFromVector
public java.lang.Object buildContainerFromVector(java.util.Vector vector, AbstractSession session)INTERNAL: Return a container populated with the contents of the specified Vector.- Overrides:
buildContainerFromVectorin classContainerPolicy
-
toStringInfo
protected java.lang.Object toStringInfo()
- Overrides:
toStringInfoin classContainerPolicy
-
-