Top Description Inners Fields Constructors Methods
org.eclipse.persistence.internal.queries

public abstract Class InterfaceContainerPolicy

extends ContainerPolicy
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.queries.MapContainerPolicy, org.eclipse.persistence.internal.queries.CollectionContainerPolicy
Imports
java.lang.ref.ReferenceQueue, .WeakReference, java.lang.reflect.InvocationTargetException, .Method, java.security.AccessController, .PrivilegedActionException, java.util.Iterator, .Vector, java.util.concurrent.ConcurrentHashMap, org.eclipse.persistence.descriptors.changetracking.CollectionChangeEvent, org.eclipse.persistence.exceptions.QueryException, .ValidationException, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, .Helper, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedClassForName, .PrivilegedGetMethod, .PrivilegedMethodInvoker, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.mappings.CollectionMapping, org.eclipse.persistence.mappings.querykeys.QueryKey

Purpose: The abstract class for ContainerPolicy's whose container class implements a container interface.

See Also
CollectionContainerPolicy, MapContainerPolicy

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected transient Method
cloneMethod

The method which will return a clone of an instance of the containerClass.

private static final ConcurrentHashMap<InterfaceContainerPolicy.ClassWeakReference<?>, Method>
protected Class<?>
containerClass

The concrete container class.

protected String
private static final ReferenceQueue<Class<T>>
Inherited from org.eclipse.persistence.internal.queries.ContainerPolicy:
constructordefaultContainerClasselementDescriptor

Constructor Summary

AccessConstructor and Description
protected
InterfaceContainerPolicy()

INTERNAL: Construct a new policy.

protected
InterfaceContainerPolicy(Class<?> containerClass)

INTERNAL: Construct a new policy for the specified class.

protected
InterfaceContainerPolicy(String containerClassName)

INTERNAL: Construct a new policy for the specified class name.

Method Summary

Modifier and TypeMethod and Description
public Object
buildContainerFromVector(Vector<E> vector, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.buildContainerFromVector.

INTERNAL: Return a container populated with the contents of the specified Vector.
public Object
cloneFor(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.cloneFor.

INTERNAL: Return a clone of the specified container.
public void
convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings.
public CollectionChangeEvent
createChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, Integer index, boolean isChangeApplied)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.createChangeEvent.

INTERNAL: Creates a CollectionChangeEvent for the container
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.

public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.equals.

INTERNAL: Return if the policy is equal to the other.
public Method
getCloneMethod()

INTERNAL: Return the 'clone()' Method for the container class.

protected Method
getCloneMethod(Class<?> javaClass)

INTERNAL: Return the 'clone()' Method for the specified class.

public Class<?>
getContainerClass()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.getContainerClass.

INTERNAL: Returns the container class to be used with this policy.
public String
public DatabaseField
getDirectKeyField(CollectionMapping mapping)

INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping.

public abstract Class<?>
public int
hashCode()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.hashCode.

Returns a hash code value for the object.
public boolean
hasNext(Object iterator)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.hasNext.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.hasNext.

INTERNAL: Return whether the iterator has more objects,
protected Object
invokeCloneMethodOn(Method method, Object container)

INTERNAL: Invoke the specified clone method on the container, handling the necessary exceptions.

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.

public boolean
isValidContainerType(Class<?> containerType)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.isValidContainerType.

INTERNAL: Validate the container type.
protected Object
next(Object iterator)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.next.

INTERNAL: Return the next object on the queue.
public void
setCloneMethod(Method cloneMethod)

INTERNAL: Set the Method that will return a clone of an instance of the containerClass.

public void
public void
protected Object
Inherited from org.eclipse.persistence.internal.queries.ContainerPolicy:
addAdditionalFieldsToQueryaddAlladdAlladdFieldsForMapKeyaddIntoaddIntoaddIntoaddIntoaddNestedJoinsQueriesForMapKeyaddNextValueFromIteratorIntobuildChangeSetForNewObjectInCollectionbuildCloneForKeybuildCollectionEntrybuildDefaultPolicybuildKeybuildKeyFromJoinedRowbuildPolicyForbuildPolicyForbuildReferencesPKListbuildSelectionQueryForDirectCollectionMappingcascadeDiscoverAndPersistUnregisteredNewObjectscascadePerformRemoveIfRequiredcascadeRegisterNewIfRequiredclearcloneclonecollectObjectForNewCollectioncompareCollectionsForChangecompareKeysconcatenateContainerscontainerInstancecontainerInstancecontainscontainscopyMapDataToRowcreateChangeSetForKeyscreateWrappedObjectFromExistingWrappedObjectdeleteWrappedObjectexecutegetAdditionalFieldsForJoingetAdditionalTablesForJoinQuerygetChangeValuesFromgetCloneDataFromChangeSetgetConstructorgetDefaultContainerClassgetDescriptorForMapKeygetElementDescriptorgetIdentityFieldsForMapKeygetKeyMappingDataForWriteQuerygetKeySelectionCriteriagetKeyTypehasElementDescriptorhasOrderinitializeinitializeConstructorisCollectionPolicyisCursoredStreamPolicyisCursorPolicyisDirectMapPolicyisEmptyisListPolicyisMapKeyObjectisMappedKeyMapPolicyisMapPolicyisOrderedListPolicyisScrollableCursorPolicyisValidContaineriterateOnMapKeyiteratorForkeyFromkeyFromEntrykeyFromIteratormergeCascadePartsmergeChangesmergeChangesnextnextEntrynextEntryoverridesReadpostCalculateChangespostCalculateChangespostInitializeprepareprepareForExecutionprocessAdditionalWritableMapKeyFieldspropagatesEventsToCollectionpropogatePostDeletepropogatePostInsertpropogatePostUpdatepropogatePreDeletepropogatePreInsertpropogatePreUpdaterecordAddToCollectionInChangeRecordrecordPrivateOwnedRemovalsrecordRemoveFromCollectionInChangeRecordrecordUpdateToCollectionInChangeRecordremoteExecuteremoveFromremoveFromremoveFromrequiresDataModificationEventssetConstructorsetDefaultContainerClasssetElementDescriptorsetKeyNamesetKeyNameshouldAddAllshouldIncludeKeyInDeleteEventshouldUpdateForeignKeysPostInsertsizeFortoStringunwrapElementunwrapIteratorResultupdateChangeRecordForSelfMergeupdateJoinedMappingIndexesForMapKeyvalueFromPKListvectorFor

Field Detail

cloneMethodback to summary
protected transient Method cloneMethod

The method which will return a clone of an instance of the containerClass.

cloneMethodCacheback to summary
private static final ConcurrentHashMap<InterfaceContainerPolicy.ClassWeakReference<?>, Method> cloneMethodCache
containerClassback to summary
protected Class<?> containerClass

The concrete container class.

containerClassNameback to summary
protected String containerClassName
refQueueback to summary
private static final ReferenceQueue<Class<T>> refQueue

Constructor Detail

InterfaceContainerPolicyback to summary
protected InterfaceContainerPolicy()

INTERNAL: Construct a new policy.

InterfaceContainerPolicyback to summary
protected InterfaceContainerPolicy(Class<?> containerClass)

INTERNAL: Construct a new policy for the specified class.

InterfaceContainerPolicyback to summary
protected InterfaceContainerPolicy(String containerClassName)

INTERNAL: Construct a new policy for the specified class name.

Method Detail

buildContainerFromVectorback to summary
public Object buildContainerFromVector(Vector<E> vector, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.buildContainerFromVector.

INTERNAL: Return a container populated with the contents of the specified Vector.

Annotations
@Override
cloneForback to summary
public Object cloneFor(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.cloneFor.

INTERNAL: Return a clone of the specified container.

Annotations
@Override
convertClassNamesToClassesback to summary
public void convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.convertClassNamesToClasses.

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.

Annotations
@Override
createChangeEventback to summary
public CollectionChangeEvent createChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, Integer index, boolean isChangeApplied)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.createChangeEvent.

INTERNAL: Creates a CollectionChangeEvent for the container

Annotations
@Override
createQueryKeyForMapKeyback to summary
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.

equalsback to summary
public boolean equals(Object object)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.equals.

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.

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCloneMethodback to summary
public Method getCloneMethod()

INTERNAL: Return the 'clone()' Method for the container class. Lazy initialization is used, so we can serialize these things.

getCloneMethodback to summary
protected Method getCloneMethod(Class<?> javaClass)

INTERNAL: Return the 'clone()' Method for the specified class. Return null if the method does not exist anywhere in the hierarchy

getContainerClassback to summary
public Class<?> getContainerClass()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.getContainerClass.

INTERNAL: Returns the container class to be used with this policy.

Annotations
@Override
getContainerClassNameback to summary
public String getContainerClassName()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.getContainerClassName.

Doc from org.eclipse.persistence.internal.queries.ContainerPolicy.getContainerClassName.

INTERNAL: Used by the MW

Annotations
@Override
getDirectKeyFieldback to summary
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.

getInterfaceTypeback to summary
public abstract Class<?> getInterfaceType()
hashCodeback to summary
public int hashCode()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasNextback to summary
public boolean hasNext(Object iterator)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.hasNext.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.hasNext.

INTERNAL: Return whether the iterator has more objects,

Annotations
@Override
invokeCloneMethodOnback to summary
protected Object invokeCloneMethodOn(Method method, Object container)

INTERNAL: Invoke the specified clone method on the container, handling the necessary exceptions.

isMapKeyAttributeback to summary
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.

isValidContainerTypeback to summary
public boolean isValidContainerType(Class<?> containerType)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.isValidContainerType.

INTERNAL: Validate the container type.

Annotations
@Override
nextback to summary
protected Object next(Object iterator)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.next.

INTERNAL: Return the next object on the queue. Valid for some subclasses only.

Annotations
@Override
setCloneMethodback to summary
public void setCloneMethod(Method cloneMethod)

INTERNAL: Set the Method that will return a clone of an instance of the containerClass.

setContainerClassback to summary
public void setContainerClass(Class<?> containerClass)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.setContainerClass.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.setContainerClass.

INTERNAL: Set the class to use as the container.

Annotations
@Override
setContainerClassNameback to summary
public void setContainerClassName(String containerClassName)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.setContainerClassName.

Doc from org.eclipse.persistence.internal.queries.ContainerPolicy.setContainerClassName.

INTERNAL: Used by the MW

Annotations
@Override
toStringInfoback to summary
protected Object toStringInfo()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.toStringInfo.

Annotations
@Override
org.eclipse.persistence.internal.queries back to summary

private final Class InterfaceContainerPolicy.ClassWeakReference<T>

extends WeakReference<Class<T>>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ClassWeakReference(Class<T> referent, ReferenceQueue<Class<T>> referenceQueue)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

hashback to summary
private final int hash

Constructor Detail

ClassWeakReferenceback to summary
pack-priv ClassWeakReference(Class<T> referent)
ClassWeakReferenceback to summary
pack-priv ClassWeakReference(Class<T> referent, ReferenceQueue<Class<T>> referenceQueue)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override