public abstract class IndirectionPolicy
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Proxy
)
ForeignReferenceMapping
,
Serialized FormConstructor and Description |
---|
IndirectionPolicy()
INTERNAL:
Construct a new indirection policy.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
backupCloneAttribute(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Return a backup clone of the attribute.
|
abstract java.lang.Object |
buildIndirectObject(ValueHolderInterface valueHolder)
INTERNAL: This method can be used when an Indirection Object is required
to be built from a provided ValueHolderInterface object.
|
java.lang.Object |
clone()
INTERNAL:
Clones itself.
|
abstract java.lang.Object |
cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
CacheKey cacheKey,
java.lang.Object clone,
java.lang.Integer refreshCascade,
AbstractSession cloningSession,
boolean buildDirectlyFromRow)
INTERNAL:
Return a clone of the attribute.
|
java.lang.Object |
extractPrimaryKeyForReferenceObject(java.lang.Object referenceObject,
AbstractSession session)
INTERNAL:
Return the primary key for the reference object (i.e.
|
abstract AbstractRecord |
extractReferenceRow(java.lang.Object referenceObject)
INTERNAL:
Return the reference row for the reference object.
|
abstract void |
fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
DistributedSession session)
INTERNAL:
An object has been serialized from the server to the client.
|
DatabaseMapping |
getMapping()
INTERNAL:
Return the database mapping that uses the indirection policy.
|
abstract java.lang.Object |
getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection object.
|
java.lang.Object |
getOriginalIndirectionObjectForMerge(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection object.
|
abstract java.lang.Object |
getOriginalValueHolder(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL: Return the original valueHolder object.
|
abstract java.lang.Object |
getRealAttributeValueFromObject(java.lang.Object object,
java.lang.Object attribute)
INTERNAL:
Return the "real" attribute value, as opposed to any wrapper.
|
abstract java.lang.Object |
getValueFromRemoteValueHolder(RemoteValueHolder remoteValueHolder)
INTERNAL:
Extract and return the appropriate value from the
specified remote value holder.
|
void |
initialize()
INTERNAL:
Initialize the indirection policy (Do nothing by default)
|
void |
instantiateObject(java.lang.Object object,
java.lang.Object attribute)
INTERNAL:
Trigger the instantiation of the value.
|
boolean |
isAttributeValueFullyBuilt(java.lang.Object attributeValue)
INTERNAL:
The method validateAttributeOfInstantiatedObject(Object attributeValue) fixes the value of the attributeValue
in cases where it is null and indirection requires that it contain some specific data structure.
|
boolean |
isWeavedObjectBasicIndirectionPolicy()
INTERNAL:
|
void |
iterateOnAttributeValue(DescriptorIterator iterator,
java.lang.Object attributeValue)
INTERNAL:
Iterate over the specified attribute value,
heeding the settings in the iterator.
|
abstract void |
mergeRemoteValueHolder(java.lang.Object clientSideDomainObject,
java.lang.Object serverSideDomainObject,
MergeManager mergeManager)
INTERNAL
Replace the client value holder with the server value holder,
after copying some of the settings from the client value holder.
|
abstract java.lang.Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
abstract boolean |
objectIsEasilyInstantiated(java.lang.Object object)
INTERNAL:
Return whether the specified object can be instantiated without database access.
|
abstract boolean |
objectIsInstantiated(java.lang.Object object)
INTERNAL:
Return whether the specified object is instantiated.
|
boolean |
objectIsInstantiatedOrChanged(java.lang.Object object)
INTERNAL:
Return whether the specified object is instantiated, or if it has changes.
|
void |
reset(java.lang.Object target)
Reset the wrapper used to store the value.
|
void |
setMapping(DatabaseMapping mapping)
INTERNAL:
set the database mapping that uses the indirection policy.
|
void |
setRealAttributeValueInObject(java.lang.Object target,
java.lang.Object attributeValue)
INTERNAL:
Set the value of the appropriate attribute of target to attributeValue.
|
void |
setRealAttributeValueInObject(java.lang.Object target,
java.lang.Object attributeValue,
boolean allowChangeTracking)
INTERNAL:
Same functionality as setRealAttributeValueInObject(Object target, Object attributeValue) but allows
overridden behavior for IndirectionPolicies that track changes
|
void |
setSourceObject(java.lang.Object sourceObject,
java.lang.Object attributeValue)
INTERNAL:
set the source object into QueryBasedValueHolder.
|
void |
setUseLazyInstantiation(java.lang.Boolean useLazyInstantiation)
ADVANCED:
This method will only change the behavior of TransparentIndirectionPolicy.
|
java.lang.Boolean |
shouldUseLazyInstantiation()
ADVANCED:
Returns false unless this is a transparent indirection policy
IndirectList and IndirectSet can be configured not to instantiate the list from the
database when you add and remove from them.
|
boolean |
usesIndirection()
INTERNAL:
Return whether the indirection policy actually uses indirection.
|
boolean |
usesTransparentIndirection()
INTERNAL:
Return whether the indirection policy uses transparent indirection.
|
java.lang.Object |
validateAttributeOfInstantiatedObject(java.lang.Object attributeValue)
INTERNAL:
Verify that the value of the attribute within an instantiated object
is of the appropriate type for the indirection policy.
|
void |
validateContainerPolicy(IntegrityChecker checker)
INTERNAL:
Verify that the container policy is compatible with the
indirection policy.
|
void |
validateDeclaredAttributeType(java.lang.Class attributeType,
IntegrityChecker checker)
INTERNAL:
Verify that attributeType is correct for the
indirection policy.
|
void |
validateDeclaredAttributeTypeForCollection(java.lang.Class attributeType,
IntegrityChecker checker)
INTERNAL:
Verify that attributeType is an appropriate collection type for the
indirection policy.
|
void |
validateGetMethodReturnType(java.lang.Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is correct for the
indirection policy.
|
void |
validateGetMethodReturnTypeForCollection(java.lang.Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is an appropriate collection type for the
indirection policy.
|
void |
validateSetMethodParameterType(java.lang.Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is correct for the
indirection policy.
|
void |
validateSetMethodParameterTypeForCollection(java.lang.Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is an appropriate collection type for the
indirection policy.
|
abstract java.lang.Object |
valueFromBatchQuery(ReadQuery batchQuery,
AbstractRecord row,
ObjectLevelReadQuery originalQuery,
CacheKey parentCacheKey)
INTERNAL:
Return the value to be stored in the object's attribute.
|
abstract java.lang.Object |
valueFromMethod(java.lang.Object object,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
abstract java.lang.Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
abstract java.lang.Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
java.lang.Object sourceObject,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
abstract java.lang.Object |
valueFromRow(java.lang.Object object)
INTERNAL:
Return the value to be stored in the object's attribute.
|
public IndirectionPolicy()
public java.lang.Object backupCloneAttribute(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, UnitOfWorkImpl unitOfWork)
public abstract java.lang.Object buildIndirectObject(ValueHolderInterface valueHolder)
public java.lang.Object clone()
clone
in class java.lang.Object
public abstract java.lang.Object cloneAttribute(java.lang.Object attributeValue, java.lang.Object original, CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean buildDirectlyFromRow)
builtDirectlyFromRow
- 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.public java.lang.Object extractPrimaryKeyForReferenceObject(java.lang.Object referenceObject, AbstractSession session)
public abstract AbstractRecord extractReferenceRow(java.lang.Object referenceObject)
public abstract void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)
public DatabaseMapping getMapping()
public abstract java.lang.Object getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject, AbstractSession session)
public java.lang.Object getOriginalIndirectionObjectForMerge(java.lang.Object unitOfWorkIndirectionObject, AbstractSession session)
public abstract java.lang.Object getOriginalValueHolder(java.lang.Object unitOfWorkIndirectionObject, AbstractSession session)
public abstract java.lang.Object getRealAttributeValueFromObject(java.lang.Object object, java.lang.Object attribute)
public void instantiateObject(java.lang.Object object, java.lang.Object attribute)
public abstract java.lang.Object getValueFromRemoteValueHolder(RemoteValueHolder remoteValueHolder)
public boolean isAttributeValueFullyBuilt(java.lang.Object attributeValue)
attributeValue
- validateAttributeOfInstantiatedObject(Object attributeValue)
public void initialize()
public boolean isWeavedObjectBasicIndirectionPolicy()
public void iterateOnAttributeValue(DescriptorIterator iterator, java.lang.Object attributeValue)
public abstract void mergeRemoteValueHolder(java.lang.Object clientSideDomainObject, java.lang.Object serverSideDomainObject, MergeManager mergeManager)
public abstract java.lang.Object nullValueFromRow()
public abstract boolean objectIsInstantiated(java.lang.Object object)
public abstract boolean objectIsEasilyInstantiated(java.lang.Object object)
public boolean objectIsInstantiatedOrChanged(java.lang.Object object)
public void setMapping(DatabaseMapping mapping)
public void setRealAttributeValueInObject(java.lang.Object target, java.lang.Object attributeValue)
public void setRealAttributeValueInObject(java.lang.Object target, java.lang.Object attributeValue, boolean allowChangeTracking)
target
- attributeValue
- allowChangeTracking
- public void setSourceObject(java.lang.Object sourceObject, java.lang.Object attributeValue)
public void setUseLazyInstantiation(java.lang.Boolean useLazyInstantiation)
public java.lang.Boolean shouldUseLazyInstantiation()
public void reset(java.lang.Object target)
public boolean usesIndirection()
public boolean usesTransparentIndirection()
public java.lang.Object validateAttributeOfInstantiatedObject(java.lang.Object attributeValue) throws DescriptorException
DescriptorException
public void validateContainerPolicy(IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateDeclaredAttributeType(java.lang.Class attributeType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateDeclaredAttributeTypeForCollection(java.lang.Class attributeType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateGetMethodReturnType(java.lang.Class returnType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateGetMethodReturnTypeForCollection(java.lang.Class returnType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateSetMethodParameterType(java.lang.Class parameterType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateSetMethodParameterTypeForCollection(java.lang.Class parameterType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public abstract java.lang.Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey)
public abstract java.lang.Object valueFromMethod(java.lang.Object object, AbstractRecord row, AbstractSession session)
public abstract java.lang.Object valueFromQuery(ReadQuery query, AbstractRecord row, java.lang.Object sourceObject, AbstractSession session)
public abstract java.lang.Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
public abstract java.lang.Object valueFromRow(java.lang.Object object)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference