public class TransparentIndirectionPolicy extends IndirectionPolicy
CollectionMapping
,
IndirectContainer
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static Integer |
defaultContainerSize |
mapping
Constructor and Description |
---|
TransparentIndirectionPolicy()
INTERNAL:
Construct a new indirection policy.
|
Modifier and Type | Method and Description |
---|---|
Object |
backupCloneAttribute(Object attributeValue,
Object clone,
Object backup,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Return a backup clone of the attribute.
|
protected Object |
buildBackupClone(IndirectContainer container)
INTERNAL:
Return a backup clone of a clone container that has not been
read from the database yet.
|
protected IndirectContainer |
buildIndirectContainer()
Construct and return an instance of the specified
indirect container class.
|
protected Object |
buildIndirectContainer(ValueHolderInterface valueHolder)
Return a new IndirectContainer with the specified value holder.
|
Object |
cloneAttribute(Object attributeValue,
Object original,
Object clone,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
Return a clone of the attribute.
|
protected boolean |
containerPolicyIsValid()
INTERNAL:
Return whether the container policy is valid for the indirection policy.
|
Vector |
extractPrimaryKeyForReferenceObject(Object referenceObject,
AbstractSession session)
INTERNAL:
Return the primary key for the reference object (i.e.
|
AbstractRecord |
extractReferenceRow(Object referenceObject)
INTERNAL:
Return the reference row for the reference object.
|
protected Class |
getContainerClass()
INTERNAL:
Return the container class for the mapping.
|
protected ContainerPolicy |
getContainerPolicy()
INTERNAL:
Return the container policy for the mapping.
|
protected static int |
getDefaultContainerSize()
INTERNAL:
Return the the size to of container to create.
|
Object |
getOriginalIndirectionObject(Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection object.
|
Object |
getRealAttributeValueFromObject(Object object,
Object attribute)
INTERNAL:
Return the "real" attribute value, as opposed to any wrapper.
|
void |
iterateOnAttributeValue(DescriptorIterator iterator,
Object attributeValue)
INTERNAL:
Iterate over the specified attribute value.
|
Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
boolean |
objectIsInstantiated(Object object)
INTERNAL:
Return whether the specified object is instantiated.
|
static void |
setDefaultContainerSize(int defaultSize)
ADVANCED:
Set the size to of container to create.
|
void |
setRealAttributeValueInObject(Object target,
Object attributeValue)
INTERNAL:
Set the value of the appropriate attribute of target to attributeValue.
|
protected boolean |
typeIsValid(Class declaredType)
INTERNAL:
Return whether the type is appropriate for the indirection policy.
|
boolean |
usesTransparentIndirection()
INTERNAL:
Return whether the indirection policy uses transparent indirection.
|
Object |
validateAttributeOfInstantiatedObject(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(Class attributeType,
IntegrityChecker checker)
INTERNAL:
Verify that attributeType is correct for the
indirection policy.
|
void |
validateGetMethodReturnType(Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is correct for the
indirection policy.
|
void |
validateSetMethodParameterType(Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is correct for the
indirection policy.
|
protected String |
validTypeName()
INTERNAL:
Return the type that is appropriate for the indirection policy.
|
Object |
valueFromMethod(Object object,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
Object object,
AbstractSession session)
INTERNAL:
A combination of valueFromQuery and valueFromRow(object).
|
Object |
valueFromRow(Object object)
INTERNAL:
Return the value to be stored in the object's attribute.
|
buildCascadeQuery, clone, getCollectionMapping, getForeignReferenceMapping, getMapping, getOneToOneMapping, getValueFromProxy, initialize, setMapping, usesIndirection, validateDeclaredAttributeTypeForCollection, validateGetMethodReturnTypeForCollection, validateSetMethodParameterTypeForCollection
protected static Integer defaultContainerSize
public TransparentIndirectionPolicy()
public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork)
backupCloneAttribute
in class IndirectionPolicy
protected Object buildBackupClone(IndirectContainer container)
protected IndirectContainer buildIndirectContainer()
protected Object buildIndirectContainer(ValueHolderInterface valueHolder)
public Object cloneAttribute(Object attributeValue, Object original, Object clone, UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow)
cloneAttribute
in class IndirectionPolicy
buildDirectlyFromRow
- 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.protected boolean containerPolicyIsValid()
public Vector extractPrimaryKeyForReferenceObject(Object referenceObject, AbstractSession session)
extractPrimaryKeyForReferenceObject
in class IndirectionPolicy
public AbstractRecord extractReferenceRow(Object referenceObject)
extractReferenceRow
in class IndirectionPolicy
protected Class getContainerClass()
protected ContainerPolicy getContainerPolicy()
protected static int getDefaultContainerSize()
public Object getOriginalIndirectionObject(Object unitOfWorkIndirectionObject, AbstractSession session)
getOriginalIndirectionObject
in class IndirectionPolicy
public Object getRealAttributeValueFromObject(Object object, Object attribute)
getRealAttributeValueFromObject
in class IndirectionPolicy
public void setRealAttributeValueInObject(Object target, Object attributeValue)
setRealAttributeValueInObject
in class IndirectionPolicy
public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue)
iterateOnAttributeValue
in class IndirectionPolicy
public Object nullValueFromRow()
nullValueFromRow
in class IndirectionPolicy
public boolean objectIsInstantiated(Object object)
objectIsInstantiated
in class IndirectionPolicy
public static void setDefaultContainerSize(int defaultSize)
protected boolean typeIsValid(Class declaredType)
public boolean usesTransparentIndirection()
usesTransparentIndirection
in class IndirectionPolicy
public Object validateAttributeOfInstantiatedObject(Object attributeValue)
validateAttributeOfInstantiatedObject
in class IndirectionPolicy
public void validateContainerPolicy(IntegrityChecker checker) throws DescriptorException
validateContainerPolicy
in class IndirectionPolicy
DescriptorException
public void validateDeclaredAttributeType(Class attributeType, IntegrityChecker checker) throws DescriptorException
validateDeclaredAttributeType
in class IndirectionPolicy
DescriptorException
public void validateGetMethodReturnType(Class returnType, IntegrityChecker checker) throws DescriptorException
validateGetMethodReturnType
in class IndirectionPolicy
DescriptorException
public void validateSetMethodParameterType(Class parameterType, IntegrityChecker checker) throws DescriptorException
validateSetMethodParameterType
in class IndirectionPolicy
DescriptorException
protected String validTypeName()
public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session)
public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
valueFromQuery
in class IndirectionPolicy
public Object valueFromQuery(ReadQuery query, AbstractRecord row, Object object, AbstractSession session)
public Object valueFromRow(Object object)
valueFromRow
in class IndirectionPolicy
Copyright © 2023. All rights reserved.