java.lang.Object
org.eclipse.persistence.descriptors.copying.AbstractCopyPolicy
- All Implemented Interfaces:
Serializable,Cloneable,CopyPolicy
- Direct Known Subclasses:
CloneCopyPolicy,InstantiationCopyPolicy,PersistenceEntityCopyPolicy,RecordCopyPolicy
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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ObjectbuildClone(Object domainObject, Session session) Return a shallow clone of the object for usage with object copying, or unit of work backup cloning.buildWorkingCopyClone(Object domainObject, Session session) By default, use thebuildClone(java.lang.Object, org.eclipse.persistence.sessions.Session).buildWorkingCopyCloneFromRow(DataRecord row, ObjectBuildingQuery query, Object primaryKey, UnitOfWork uow) By default, create a new instance.clone()INTERNAL: Clones the CopyPolicyprotected ClassDescriptorReturn the descriptor.voidinitialize(Session session) Do nothing by default.voidsetDescriptor(ClassDescriptor descriptor) Set the descriptor.toString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.persistence.descriptors.copying.CopyPolicy
buildsNewInstance
-
Field Details
-
descriptor
-
-
Constructor Details
-
AbstractCopyPolicy
protected AbstractCopyPolicy()
-
-
Method Details
-
buildClone
Description 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 Object buildWorkingCopyClone(Object domainObject, Session session) throws DescriptorException By default, use thebuildClone(java.lang.Object, org.eclipse.persistence.sessions.Session).- Specified by:
buildWorkingCopyClonein interfaceCopyPolicy- Throws:
DescriptorException
-
buildWorkingCopyCloneFromRow
public Object buildWorkingCopyCloneFromRow(DataRecord row, ObjectBuildingQuery query, Object primaryKey, UnitOfWork uow) throws DescriptorException By default, create a new instance.- Specified by:
buildWorkingCopyCloneFromRowin interfaceCopyPolicy- Throws:
DescriptorException
-
clone
INTERNAL: Clones the CopyPolicy- Specified by:
clonein interfaceCopyPolicy- Overrides:
clonein classObject
-
getDescriptor
Return the descriptor. -
initialize
Do nothing by default.- Specified by:
initializein interfaceCopyPolicy- Throws:
DescriptorException
-
setDescriptor
Set the descriptor.- Specified by:
setDescriptorin interfaceCopyPolicy
-
toString
-