public abstract class AbstractCopyPolicy extends java.lang.Object implements CopyPolicy
Purpose: Allows customization of how an object is cloned. This class defines common behavoir that allows a subclass to be used and set on a descriptor to provide a special cloning routine for how an object is cloned in a unit of work.
| Modifier and Type | Field and Description |
|---|---|
protected ClassDescriptor |
descriptor |
| Constructor and Description |
|---|
AbstractCopyPolicy() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.Object |
buildClone(java.lang.Object domainObject,
Session session)
Return a shallow clone of the object for usage with object copying, or unit of work backup cloning.
|
abstract boolean |
buildsNewInstance()
Return if a new instance is created or a clone.
|
java.lang.Object |
buildWorkingCopyClone(java.lang.Object domainObject,
Session session)
By default use the buildClone.
|
java.lang.Object |
buildWorkingCopyCloneFromRow(Record row,
ObjectBuildingQuery query)
By default create a new instance.
|
java.lang.Object |
buildWorkingCopyCloneFromRow(Record row,
ObjectLevelReadQuery query)
Create a new instance, unless a workingCopyClone method is specified, then build a new instance and clone it.
|
java.lang.Object |
clone()
INTERNAL:
Clones the CopyPolicy
|
protected ClassDescriptor |
getDescriptor()
Return the descriptor.
|
void |
initialize(Session session)
Do nothing by default.
|
void |
setDescriptor(ClassDescriptor descriptor)
Set the descriptor.
|
protected ClassDescriptor descriptor
public abstract java.lang.Object buildClone(java.lang.Object domainObject,
Session session)
throws DescriptorException
CopyPolicybuildClone in interface CopyPolicyDescriptorExceptionpublic java.lang.Object buildWorkingCopyClone(java.lang.Object domainObject,
Session session)
throws DescriptorException
buildWorkingCopyClone in interface CopyPolicyDescriptorExceptionpublic java.lang.Object buildWorkingCopyCloneFromRow(Record row, ObjectLevelReadQuery query) throws DescriptorException
buildWorkingCopyCloneFromRow in interface CopyPolicyDescriptorExceptionpublic java.lang.Object buildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query) throws DescriptorException
buildWorkingCopyCloneFromRow in interface CopyPolicyDescriptorExceptionpublic java.lang.Object clone()
clone in interface CopyPolicyclone in class java.lang.Objectprotected ClassDescriptor getDescriptor()
public void initialize(Session session) throws DescriptorException
initialize in interface CopyPolicyDescriptorExceptionpublic void setDescriptor(ClassDescriptor descriptor)
setDescriptor in interface CopyPolicypublic abstract boolean buildsNewInstance()
buildsNewInstance in interface CopyPolicy