public class TransparentIndirectionPolicy extends IndirectionPolicy
CollectionMapping,
IndirectContainer,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.Integer |
defaultContainerSize |
mapping| Constructor and Description |
|---|
TransparentIndirectionPolicy()
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.
|
protected java.lang.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 java.lang.Object |
buildIndirectContainer(ValueHolderInterface valueHolder)
Return a new IndirectContainer with the specified value holder.
|
java.lang.Object |
cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.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.
|
java.util.Vector |
extractPrimaryKeyForReferenceObject(java.lang.Object referenceObject,
AbstractSession session)
INTERNAL:
Return the primary key for the reference object (i.e.
|
AbstractRecord |
extractReferenceRow(java.lang.Object referenceObject)
INTERNAL:
Return the reference row for the reference object.
|
protected java.lang.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.
|
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 |
getRealAttributeValueFromObject(java.lang.Object object,
java.lang.Object attribute)
INTERNAL:
Return the "real" attribute value, as opposed to any wrapper.
|
void |
iterateOnAttributeValue(DescriptorIterator iterator,
java.lang.Object attributeValue)
INTERNAL:
Iterate over the specified attribute value.
|
java.lang.Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
boolean |
objectIsInstantiated(java.lang.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(java.lang.Object target,
java.lang.Object attributeValue)
INTERNAL:
Set the value of the appropriate attribute of target to attributeValue.
|
protected boolean |
typeIsValid(java.lang.Class declaredType)
INTERNAL:
Return whether the type is appropriate for the indirection policy.
|
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 |
validateGetMethodReturnType(java.lang.Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is correct for the
indirection policy.
|
void |
validateSetMethodParameterType(java.lang.Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is correct for the
indirection policy.
|
protected java.lang.String |
validTypeName()
INTERNAL:
Return the type that is appropriate for the indirection policy.
|
java.lang.Object |
valueFromMethod(java.lang.Object object,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
java.lang.Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
java.lang.Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
java.lang.Object object,
AbstractSession session)
INTERNAL:
A combination of valueFromQuery and valueFromRow(object).
|
java.lang.Object |
valueFromRow(java.lang.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, validateSetMethodParameterTypeForCollectionpublic TransparentIndirectionPolicy()
public java.lang.Object backupCloneAttribute(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
backupCloneAttribute in class IndirectionPolicyprotected java.lang.Object buildBackupClone(IndirectContainer container)
protected IndirectContainer buildIndirectContainer()
protected java.lang.Object buildIndirectContainer(ValueHolderInterface valueHolder)
public java.lang.Object cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.Object clone,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
cloneAttribute in class IndirectionPolicybuildDirectlyFromRow - 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 java.util.Vector extractPrimaryKeyForReferenceObject(java.lang.Object referenceObject,
AbstractSession session)
extractPrimaryKeyForReferenceObject in class IndirectionPolicypublic AbstractRecord extractReferenceRow(java.lang.Object referenceObject)
extractReferenceRow in class IndirectionPolicyprotected java.lang.Class getContainerClass()
protected ContainerPolicy getContainerPolicy()
protected static int getDefaultContainerSize()
public java.lang.Object getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
getOriginalIndirectionObject in class IndirectionPolicypublic java.lang.Object getRealAttributeValueFromObject(java.lang.Object object,
java.lang.Object attribute)
getRealAttributeValueFromObject in class IndirectionPolicypublic void setRealAttributeValueInObject(java.lang.Object target,
java.lang.Object attributeValue)
setRealAttributeValueInObject in class IndirectionPolicypublic void iterateOnAttributeValue(DescriptorIterator iterator, java.lang.Object attributeValue)
iterateOnAttributeValue in class IndirectionPolicypublic java.lang.Object nullValueFromRow()
nullValueFromRow in class IndirectionPolicypublic boolean objectIsInstantiated(java.lang.Object object)
objectIsInstantiated in class IndirectionPolicypublic static void setDefaultContainerSize(int defaultSize)
protected boolean typeIsValid(java.lang.Class declaredType)
public boolean usesTransparentIndirection()
usesTransparentIndirection in class IndirectionPolicypublic java.lang.Object validateAttributeOfInstantiatedObject(java.lang.Object attributeValue)
validateAttributeOfInstantiatedObject in class IndirectionPolicypublic void validateContainerPolicy(IntegrityChecker checker) throws DescriptorException
validateContainerPolicy in class IndirectionPolicyDescriptorExceptionpublic void validateDeclaredAttributeType(java.lang.Class attributeType,
IntegrityChecker checker)
throws DescriptorException
validateDeclaredAttributeType in class IndirectionPolicyDescriptorExceptionpublic void validateGetMethodReturnType(java.lang.Class returnType,
IntegrityChecker checker)
throws DescriptorException
validateGetMethodReturnType in class IndirectionPolicyDescriptorExceptionpublic void validateSetMethodParameterType(java.lang.Class parameterType,
IntegrityChecker checker)
throws DescriptorException
validateSetMethodParameterType in class IndirectionPolicyDescriptorExceptionprotected java.lang.String validTypeName()
public java.lang.Object valueFromMethod(java.lang.Object object,
AbstractRecord row,
AbstractSession session)
public java.lang.Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
valueFromQuery in class IndirectionPolicypublic java.lang.Object valueFromQuery(ReadQuery query, AbstractRecord row, java.lang.Object object, AbstractSession session)
public java.lang.Object valueFromRow(java.lang.Object object)
valueFromRow in class IndirectionPolicy