public abstract class IndirectionPolicy extends Object implements Cloneable, Serializable
Proxy
)
ForeignReferenceMapping
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected DatabaseMapping |
mapping |
Constructor and Description |
---|
IndirectionPolicy()
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 ReadObjectQuery |
buildCascadeQuery(MergeManager mergeManager)
INTERNAL
Return true if the refresh shoud refresh on this mapping or not.
|
Object |
clone()
INTERNAL:
Clones itself.
|
abstract Object |
cloneAttribute(Object attributeValue,
Object original,
Object clone,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
INTERNAL:
Return a clone of the attribute.
|
Vector |
extractPrimaryKeyForReferenceObject(Object referenceObject,
AbstractSession session)
INTERNAL:
Return the primary key for the reference object (i.e.
|
abstract AbstractRecord |
extractReferenceRow(Object referenceObject)
INTERNAL:
Return the reference row for the reference object.
|
protected CollectionMapping |
getCollectionMapping()
INTERNAL:
Reduce casting clutter....
|
protected ForeignReferenceMapping |
getForeignReferenceMapping()
INTERNAL:
Reduce casting clutter....
|
DatabaseMapping |
getMapping()
INTERNAL:
Return the database mapping that uses the indirection policy.
|
protected ObjectReferenceMapping |
getOneToOneMapping()
INTERNAL:
Reduce casting clutter....
|
abstract Object |
getOriginalIndirectionObject(Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection object.
|
abstract Object |
getRealAttributeValueFromObject(Object object,
Object attribute)
INTERNAL:
Return the "real" attribute value, as opposed to any wrapper.
|
static Object |
getValueFromProxy(Object value)
INTERNAL:
Given a proxy object, trigger the indirection and return the actual object represented by the proxy.
|
void |
initialize()
INTERNAL:
Initialize the indirection policy (Do nothing by default)
|
void |
iterateOnAttributeValue(DescriptorIterator iterator,
Object attributeValue)
INTERNAL:
Iterate over the specified attribute value,
heeding the settings in the iterator.
|
abstract Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
abstract boolean |
objectIsInstantiated(Object object)
INTERNAL:
Return whether the specified object is instantiated.
|
void |
setMapping(DatabaseMapping mapping)
INTERNAL:
set the database mapping that uses the indirection policy.
|
void |
setRealAttributeValueInObject(Object target,
Object attributeValue)
INTERNAL:
Set the value of the appropriate attribute of target to attributeValue.
|
boolean |
usesIndirection()
INTERNAL:
Return whether the indirection policy actually uses indirection.
|
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 |
validateDeclaredAttributeTypeForCollection(Class attributeType,
IntegrityChecker checker)
INTERNAL:
Verify that attributeType is an appropriate collection type for the
indirection policy.
|
void |
validateGetMethodReturnType(Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is correct for the
indirection policy.
|
void |
validateGetMethodReturnTypeForCollection(Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that getter returnType is an appropriate collection type for the
indirection policy.
|
void |
validateSetMethodParameterType(Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is correct for the
indirection policy.
|
void |
validateSetMethodParameterTypeForCollection(Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that setter parameterType is an appropriate collection type for the
indirection policy.
|
abstract Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
abstract Object |
valueFromRow(Object object)
INTERNAL:
Return the value to be stored in the object's attribute.
|
protected DatabaseMapping mapping
public IndirectionPolicy()
public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork)
protected ReadObjectQuery buildCascadeQuery(MergeManager mergeManager)
public abstract Object cloneAttribute(Object attributeValue, Object original, Object clone, UnitOfWorkImpl unitOfWork, 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 Vector extractPrimaryKeyForReferenceObject(Object referenceObject, AbstractSession session)
public abstract AbstractRecord extractReferenceRow(Object referenceObject)
protected CollectionMapping getCollectionMapping()
protected ForeignReferenceMapping getForeignReferenceMapping()
public DatabaseMapping getMapping()
protected ObjectReferenceMapping getOneToOneMapping()
public abstract Object getOriginalIndirectionObject(Object unitOfWorkIndirectionObject, AbstractSession session)
public abstract Object getRealAttributeValueFromObject(Object object, Object attribute)
public static Object getValueFromProxy(Object value)
public void initialize()
public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue)
public abstract Object nullValueFromRow()
public abstract boolean objectIsInstantiated(Object object)
public void setMapping(DatabaseMapping mapping)
public void setRealAttributeValueInObject(Object target, Object attributeValue)
public boolean usesIndirection()
public boolean usesTransparentIndirection()
public Object validateAttributeOfInstantiatedObject(Object attributeValue) throws DescriptorException
DescriptorException
public void validateContainerPolicy(IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateDeclaredAttributeType(Class attributeType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateDeclaredAttributeTypeForCollection(Class attributeType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateGetMethodReturnType(Class returnType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateGetMethodReturnTypeForCollection(Class returnType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateSetMethodParameterType(Class parameterType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public void validateSetMethodParameterTypeForCollection(Class parameterType, IntegrityChecker checker) throws DescriptorException
DescriptorException
public abstract Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
Copyright © 2024. All rights reserved.