public abstract class IndirectionPolicy
extends java.lang.Object
implements java.lang.Cloneable, java.io.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 |
---|---|
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 ReadObjectQuery |
buildCascadeQuery(MergeManager mergeManager)
INTERNAL
Return true if the refresh shoud refresh on this mapping or not.
|
java.lang.Object |
clone()
INTERNAL:
Clones itself.
|
abstract java.lang.Object |
cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.Object clone,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
INTERNAL:
Return a clone of the attribute.
|
java.util.Vector |
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.
|
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 java.lang.Object |
getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection 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.
|
static java.lang.Object |
getValueFromProxy(java.lang.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,
java.lang.Object attributeValue)
INTERNAL:
Iterate over the specified attribute value,
heeding the settings in the iterator.
|
abstract java.lang.Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
abstract boolean |
objectIsInstantiated(java.lang.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(java.lang.Object target,
java.lang.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.
|
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 |
valueFromQuery(ReadQuery query,
AbstractRecord row,
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.
|
protected DatabaseMapping mapping
public IndirectionPolicy()
public java.lang.Object backupCloneAttribute(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, UnitOfWorkImpl unitOfWork)
protected ReadObjectQuery buildCascadeQuery(MergeManager mergeManager)
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, java.lang.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 java.util.Vector extractPrimaryKeyForReferenceObject(java.lang.Object referenceObject, AbstractSession session)
public abstract AbstractRecord extractReferenceRow(java.lang.Object referenceObject)
protected CollectionMapping getCollectionMapping()
protected ForeignReferenceMapping getForeignReferenceMapping()
public DatabaseMapping getMapping()
protected ObjectReferenceMapping getOneToOneMapping()
public abstract java.lang.Object getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject, AbstractSession session)
public abstract java.lang.Object getRealAttributeValueFromObject(java.lang.Object object, java.lang.Object attribute)
public static java.lang.Object getValueFromProxy(java.lang.Object value)
public void initialize()
public void iterateOnAttributeValue(DescriptorIterator iterator, java.lang.Object attributeValue)
public abstract java.lang.Object nullValueFromRow()
public abstract boolean objectIsInstantiated(java.lang.Object object)
public void setMapping(DatabaseMapping mapping)
public void setRealAttributeValueInObject(java.lang.Object target, java.lang.Object attributeValue)
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 valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
public abstract java.lang.Object valueFromRow(java.lang.Object object)