Class AbstractCopyPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.copying.AbstractCopyPolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CopyPolicy
- Direct Known Subclasses:
CloneCopyPolicy,InstantiationCopyPolicy,PersistenceEntityCopyPolicy
public abstract class AbstractCopyPolicy extends java.lang.Object implements CopyPolicy
Purpose: Allows customization of how an object is cloned. This class defines common behavior 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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassDescriptordescriptor
-
Constructor Summary
Constructors Constructor Description AbstractCopyPolicy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.ObjectbuildClone(java.lang.Object domainObject, Session session)Return a shallow clone of the object for usage with object copying, or unit of work backup cloning.java.lang.ObjectbuildWorkingCopyClone(java.lang.Object domainObject, Session session)By default use the buildClone.java.lang.ObjectbuildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query, java.lang.Object primaryKey, UnitOfWork uow)By default create a new instance.java.lang.Objectclone()INTERNAL: Clones the CopyPolicyprotected ClassDescriptorgetDescriptor()Return the descriptor.voidinitialize(Session session)Do nothing by default.voidsetDescriptor(ClassDescriptor descriptor)Set the descriptor.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.descriptors.copying.CopyPolicy
buildsNewInstance
-
-
-
-
Field Detail
-
descriptor
protected ClassDescriptor descriptor
-
-
Method Detail
-
buildClone
public abstract java.lang.Object buildClone(java.lang.Object domainObject, Session session) throws DescriptorExceptionDescription copied from interface:CopyPolicyReturn a shallow clone of the object for usage with object copying, or unit of work backup cloning.- Specified by:
buildClonein interfaceCopyPolicy- Throws:
DescriptorException
-
buildWorkingCopyClone
public java.lang.Object buildWorkingCopyClone(java.lang.Object domainObject, Session session) throws DescriptorExceptionBy default use the buildClone.- Specified by:
buildWorkingCopyClonein interfaceCopyPolicy- Throws:
DescriptorException
-
buildWorkingCopyCloneFromRow
public java.lang.Object buildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query, java.lang.Object primaryKey, UnitOfWork uow) throws DescriptorException
By default create a new instance.- Specified by:
buildWorkingCopyCloneFromRowin interfaceCopyPolicy- Throws:
DescriptorException
-
clone
public java.lang.Object clone()
INTERNAL: Clones the CopyPolicy- Specified by:
clonein interfaceCopyPolicy- Overrides:
clonein classjava.lang.Object
-
getDescriptor
protected ClassDescriptor getDescriptor()
Return the descriptor.
-
initialize
public void initialize(Session session) throws DescriptorException
Do nothing by default.- Specified by:
initializein interfaceCopyPolicy- Throws:
DescriptorException
-
setDescriptor
public void setDescriptor(ClassDescriptor descriptor)
Set the descriptor.- Specified by:
setDescriptorin interfaceCopyPolicy
-
-