Top Description Fields Constructors Methods
org.eclipse.persistence.internal.indirection

public Class NoIndirectionPolicy

extends IndirectionPolicy
Class Inheritance
Imports
java.beans.PropertyChangeEvent, .PropertyChangeListener, java.util.Map, org.eclipse.persistence.descriptors.changetracking.ChangeTracker, org.eclipse.persistence.exceptions.DescriptorException, .IntegrityChecker, org.eclipse.persistence.indirection.ValueHolderInterface, org.eclipse.persistence.internal.helper.ClassConstants, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.queries.InterfaceContainerPolicy, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .UnitOfWorkImpl, org.eclipse.persistence.internal.sessions.remote.ObjectDescriptor, .RemoteValueHolder, org.eclipse.persistence.queries.ObjectLevelReadQuery, .ReadQuery, org.eclipse.persistence.sessions.remote.DistributedSession

Purpose

: NoIndirectionPolicy implements the behavior necessary for a a org.eclipse.persistence.mappings.ForeignReferenceMapping (or TransformationMapping) to directly use domain objects, as opposed to ValueHolders.
Author
Mike Norman
Since
TOPLink/Java 2.5

Field Summary

Inherited from org.eclipse.persistence.internal.indirection.IndirectionPolicy:
mapping

Constructor Summary

AccessConstructor and Description
public
NoIndirectionPolicy()

INTERNAL: Construct a new indirection policy.

Method Summary

Modifier and TypeMethod and Description
public Object
buildIndirectObject(ValueHolderInterface<T> valueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.buildIndirectObject.

INTERNAL: This method can be used when an Indirection Object is required to be built from a provided ValueHolderInterface object.
public Object
cloneAttribute(Object attributeValue, Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession, boolean
indicates that we are building the clone directly from a row as opposed to building the original from the row, putting it in the shared cache, and then cloning the original.
buildDirectlyFromRow
)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.cloneAttribute.

INTERNAL: Return a clone of the attribute.
protected boolean
collectionTypeIsValid(Class<?> collectionType)

INTERNAL: Return whether the collection type is appropriate for the indirection policy.

public AbstractRecord
extractReferenceRow(Object referenceObject)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.extractReferenceRow.

INTERNAL: Return the reference row for the reference object.
public void
fixObjectReferences(Object object, Map<Object, ObjectDescriptor> objectDescriptors, Map<Object, Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.fixObjectReferences.

INTERNAL: An object has been serialized from the server to the client.
public Object
getOriginalIndirectionObject(Object unitOfWorkIndirectionObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getOriginalIndirectionObject.

INTERNAL: Return the original indirection object for a unit of work indirection object.
public Object
getOriginalValueHolder(Object unitOfWorkIndirectionObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getOriginalValueHolder.

INTERNAL: Return the original valueHolder object.
public Object
getRealAttributeValueFromObject(Object object, Object attribute)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getRealAttributeValueFromObject.

INTERNAL: Return the "real" attribute value, as opposed to any wrapper.
public Object
getValueFromRemoteValueHolder(RemoteValueHolder<?> remoteValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getValueFromRemoteValueHolder.

INTERNAL: Extract and return the appropriate value from the specified remote value holder.
public void
mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.mergeRemoteValueHolder.

INTERNAL Replace the client value holder with the server value holder, after copying some of the settings from the client value holder.
public Object
nullValueFromRow()

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.nullValueFromRow.

INTERNAL: Return the null value of the appropriate attribute.
public boolean
objectIsEasilyInstantiated(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.objectIsEasilyInstantiated.

INTERNAL: Return whether the specified object can be instantiated without database access.
public boolean
objectIsInstantiated(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.objectIsInstantiated.

INTERNAL: Return whether the specified object is instantiated.
public void
setRealAttributeValueInObject(Object target, Object attributeValue, boolean trackChanges)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.setRealAttributeValueInObject.

Set the value of the appropriate attribute of target to attributeValue.
protected boolean
typeIsValid(Class<?> attributeType)

INTERNAL: Return whether the type is appropriate for the indirection policy.

public boolean
usesIndirection()

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.usesIndirection.

INTERNAL: Return whether the indirection policy actually uses indirection.
public void
validateDeclaredAttributeType(Class<?> attributeType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateDeclaredAttributeType.

INTERNAL: Verify that attributeType is correct for the indirection policy.
public void
validateDeclaredAttributeTypeForCollection(Class<?> attributeType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateDeclaredAttributeTypeForCollection.

INTERNAL: Verify that attributeType is an appropriate collection type for the indirection policy.
public void
validateGetMethodReturnType(Class<?> returnType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateGetMethodReturnType.

INTERNAL: Verify that getter returnType is correct for the indirection policy.
public void
validateGetMethodReturnTypeForCollection(Class<?> returnType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateGetMethodReturnTypeForCollection.

INTERNAL: Verify that getter returnType is an appropriate collection type for the indirection policy.
public void
validateSetMethodParameterType(Class<?> parameterType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateSetMethodParameterType.

INTERNAL: Verify that setter parameterType is correct for the indirection policy.
public void
validateSetMethodParameterTypeForCollection(Class<?> parameterType, IntegrityChecker checker)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateSetMethodParameterTypeForCollection.

INTERNAL: Verify that setter parameterType is an appropriate collection type for the indirection policy.
public Object
valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromBatchQuery.

INTERNAL: Return the value to be stored in the object's attribute.
public Object
valueFromMethod(Object object, AbstractRecord row, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromMethod.

INTERNAL: Return the value to be stored in the object's attribute.
public Object
valueFromQuery(ReadQuery query, AbstractRecord row, Object sourceObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromQuery.

INTERNAL: Return the value to be stored in the object's attribute.
public Object
valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromQuery.

INTERNAL: Return the value to be stored in the object's attribute.
public Object
valueFromRow(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromRow.

INTERNAL: Return the value to be stored in the object's attribute.
Inherited from org.eclipse.persistence.internal.indirection.IndirectionPolicy:
backupCloneAttributebuildCascadeQuerycloneextractPrimaryKeyForReferenceObjectgetCollectionMappinggetForeignReferenceMappinggetMappinggetOneToOneMappinggetOriginalIndirectionObjectForMergegetTransformationMappinginitializeinstantiateObjectisAttributeValueFullyBuiltisWeavedObjectBasicIndirectionPolicyiterateOnAttributeValuemergeClientIntoServerValueHolderobjectIsInstantiatedOrChangedresetsetMappingsetRealAttributeValueInObjectsetSourceObjectsetUseLazyInstantiationshouldUseLazyInstantiationusesTransparentIndirectionvalidateAttributeOfInstantiatedObjectvalidateContainerPolicy

Constructor Detail

NoIndirectionPolicyback to summary
public NoIndirectionPolicy()

INTERNAL: Construct a new indirection policy.

Method Detail

buildIndirectObjectback to summary
public Object buildIndirectObject(ValueHolderInterface<T> valueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.buildIndirectObject.

INTERNAL: This method can be used when an Indirection Object is required to be built from a provided ValueHolderInterface object. This may be used for custom value holder types. Certain policies like the TransparentIndirectionPolicy may wrap the valueholder in another object.

Annotations
@Override
cloneAttributeback to summary
public Object cloneAttribute(Object attributeValue, Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession, boolean buildDirectlyFromRow)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.cloneAttribute.

INTERNAL: Return a clone of the attribute.

Parameters
buildDirectlyFromRow:boolean

indicates that we are building the clone directly from a row as opposed to building the original from the row, putting it in the shared cache, and then cloning the original.

Annotations
@Override
collectionTypeIsValidback to summary
protected boolean collectionTypeIsValid(Class<?> collectionType)

INTERNAL: Return whether the collection type is appropriate for the indirection policy. In this case, the type MUST be a Vector (or, in the case of jdk1.2, Collection or Map).

extractReferenceRowback to summary
public AbstractRecord extractReferenceRow(Object referenceObject)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.extractReferenceRow.

INTERNAL: Return the reference row for the reference object. This allows the new row to be built without instantiating the reference object. Return null if the object has already been instantiated.

Annotations
@Override
fixObjectReferencesback to summary
public void fixObjectReferences(Object object, Map<Object, ObjectDescriptor> objectDescriptors, Map<Object, Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.fixObjectReferences.

INTERNAL: An object has been serialized from the server to the client. Replace the transient attributes of the remote value holders with client-side objects.

Annotations
@Override
getOriginalIndirectionObjectback to summary
public Object getOriginalIndirectionObject(Object unitOfWorkIndirectionObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getOriginalIndirectionObject.

INTERNAL: Return the original indirection object for a unit of work indirection object.

Annotations
@Override
getOriginalValueHolderback to summary
public Object getOriginalValueHolder(Object unitOfWorkIndirectionObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getOriginalValueHolder.

INTERNAL: Return the original valueHolder object. Access to the underlying valueholder may be required when serializing the valueholder or converting the valueHolder to another type.

Annotations
@Override
getRealAttributeValueFromObjectback to summary
public Object getRealAttributeValueFromObject(Object object, Object attribute)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getRealAttributeValueFromObject.

INTERNAL: Return the "real" attribute value, as opposed to any wrapper. This will trigger the wrapper to instantiate the value.

Annotations
@Override
getValueFromRemoteValueHolderback to summary
public Object getValueFromRemoteValueHolder(RemoteValueHolder<?> remoteValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.getValueFromRemoteValueHolder.

INTERNAL: Extract and return the appropriate value from the specified remote value holder.

Annotations
@Override
mergeRemoteValueHolderback to summary
public void mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.mergeRemoteValueHolder.

INTERNAL Replace the client value holder with the server value holder, after copying some of the settings from the client value holder.

Annotations
@Override
nullValueFromRowback to summary
public Object nullValueFromRow()

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.nullValueFromRow.

INTERNAL: Return the null value of the appropriate attribute. That is, the field from the database is NULL, return what should be placed in the object's attribute as a result.

Annotations
@Override
objectIsEasilyInstantiatedback to summary
public boolean objectIsEasilyInstantiated(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.objectIsEasilyInstantiated.

INTERNAL: Return whether the specified object can be instantiated without database access.

Annotations
@Override
objectIsInstantiatedback to summary
public boolean objectIsInstantiated(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.objectIsInstantiated.

INTERNAL: Return whether the specified object is instantiated.

Annotations
@Override
setRealAttributeValueInObjectback to summary
public void setRealAttributeValueInObject(Object target, Object attributeValue, boolean trackChanges)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.setRealAttributeValueInObject.

Set the value of the appropriate attribute of target to attributeValue. In this case, place the value inside the target's ValueHolder. if trackChanges is true, set the value in the object as if the user was setting it. Allow change tracking to pick up the change.

Annotations
@Override
typeIsValidback to summary
protected boolean typeIsValid(Class<?> attributeType)

INTERNAL: Return whether the type is appropriate for the indirection policy. In this case, the attribute type CANNOT be ValueHolderInterface.

usesIndirectionback to summary
public boolean usesIndirection()

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.usesIndirection.

INTERNAL: Return whether the indirection policy actually uses indirection. Here, we must reply false.

Annotations
@Override
validateDeclaredAttributeTypeback to summary
public void validateDeclaredAttributeType(Class<?> attributeType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateDeclaredAttributeType.

INTERNAL: Verify that attributeType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type CANNOT be ValueHolderInterface.

Annotations
@Override
validateDeclaredAttributeTypeForCollectionback to summary
public void validateDeclaredAttributeTypeForCollection(Class<?> attributeType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateDeclaredAttributeTypeForCollection.

INTERNAL: Verify that attributeType is an appropriate collection type for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the type MUST be a Vector (or, in the case of jdk1.2, Collection or Map).

Annotations
@Override
validateGetMethodReturnTypeback to summary
public void validateGetMethodReturnType(Class<?> returnType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateGetMethodReturnType.

INTERNAL: Verify that getter returnType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the return type CANNOT be ValueHolderInterface.

Annotations
@Override
validateGetMethodReturnTypeForCollectionback to summary
public void validateGetMethodReturnTypeForCollection(Class<?> returnType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateGetMethodReturnTypeForCollection.

INTERNAL: Verify that getter returnType is an appropriate collection type for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the type MUST be a Vector (or, in the case of jdk1.2, Collection or Map).

Annotations
@Override
validateSetMethodParameterTypeback to summary
public void validateSetMethodParameterType(Class<?> parameterType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateSetMethodParameterType.

INTERNAL: Verify that setter parameterType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the parameter type CANNOT be ValueHolderInterface.

Annotations
@Override
validateSetMethodParameterTypeForCollectionback to summary
public void validateSetMethodParameterTypeForCollection(Class<?> parameterType, IntegrityChecker checker) throws DescriptorException

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.validateSetMethodParameterTypeForCollection.

INTERNAL: Verify that setter parameterType is an appropriate collection type for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the type MUST be a Vector (or, in the case of jdk1.2, Collection or Map).

Annotations
@Override
valueFromBatchQueryback to summary
public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromBatchQuery.

INTERNAL: Return the value to be stored in the object's attribute. This value is determined by the batchQuery. In this case, extract the result from the query.

Annotations
@Override
valueFromMethodback to summary
public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromMethod.

INTERNAL: Return the value to be stored in the object's attribute. This value is determined by invoking the mapping's AttributeTransformer

Annotations
@Override
valueFromQueryback to summary
public Object valueFromQuery(ReadQuery query, AbstractRecord row, Object sourceObject, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromQuery.

INTERNAL: Return the value to be stored in the object's attribute. This value is determined by the query. In this case, wrap the query in a ValueHolder for later invocation.

Annotations
@Override
valueFromQueryback to summary
public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromQuery.

INTERNAL: Return the value to be stored in the object's attribute. This value is determined by the query. In this case, simply execute the query and return its results.

Annotations
@Override
valueFromRowback to summary
public Object valueFromRow(Object object)

Implements abstract org.eclipse.persistence.internal.indirection.IndirectionPolicy.valueFromRow.

INTERNAL: Return the value to be stored in the object's attribute. This value is determined by the row. In this case, simply return the object.

Annotations
@Override