FileDocCategorySizeDatePackage
CopyPolicy.javaAPI DocGlassfish v2 API4286Tue May 22 16:54:18 BST 2007oracle.toplink.essentials.descriptors.copying

CopyPolicy

public interface CopyPolicy implements Serializable, Cloneable

Purpose: Allows customization of how an object is cloned. An implementer of CopyPolicy can be set on a descriptor to provide special cloning routine for how an object is cloned in a unit of work. By default the InstantiationCopyPolicy is used which creates a new instance of the class to be copied into. The MethodBasedCopyPolicy can also be used that uses a clone method in the object to clone the object. When a clone method is used it avoid the requirement of having to copy over each of the direct attributes.

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectbuildClone(java.lang.Object object, oracle.toplink.essentials.sessions.Session session)
Return a shallow clone of the object for usage with object copying, or unit of work backup cloning.

public java.lang.ObjectbuildWorkingCopyClone(java.lang.Object object, oracle.toplink.essentials.sessions.Session session)
Return a shallow clone of the object for usage with the unit of work working copy.

public java.lang.ObjectbuildWorkingCopyCloneFromRow(oracle.toplink.essentials.sessions.Record row, oracle.toplink.essentials.queryframework.ObjectBuildingQuery query)
Return an instance with the primary key set from the row, used for building a working copy during a unit of work transactional read.

public java.lang.ObjectbuildWorkingCopyCloneFromRow(oracle.toplink.essentials.sessions.Record row, oracle.toplink.essentials.queryframework.ObjectLevelReadQuery query)
Return an instance with the primary key set from the row, used for building a working copy during a unit of work transactional read.

public booleanbuildsNewInstance()
Return if this copy policy creates a new instance, vs a clone.

public java.lang.Objectclone()
Clone the CopyPolicy.

public voidinitialize(oracle.toplink.essentials.sessions.Session session)
Allow for any initialization or validation required.

public voidsetDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
Set the descriptor.