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

AbstractCopyPolicy

public abstract class AbstractCopyPolicy extends 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.

Fields Summary
protected ClassDescriptor
descriptor
Constructors Summary
public AbstractCopyPolicy()

        super();
    
Methods Summary
public abstract java.lang.ObjectbuildClone(java.lang.Object domainObject, oracle.toplink.essentials.sessions.Session session)

public java.lang.ObjectbuildWorkingCopyClone(java.lang.Object domainObject, oracle.toplink.essentials.sessions.Session session)
By default use the buildClone.

        return buildClone(domainObject, session);
    
public java.lang.ObjectbuildWorkingCopyCloneFromRow(oracle.toplink.essentials.sessions.Record row, oracle.toplink.essentials.queryframework.ObjectLevelReadQuery query)
Create a new instance, unless a workingCopyClone method is specified, then build a new instance and clone it.

        return this.buildWorkingCopyCloneFromRow(row, (ObjectBuildingQuery)query);
    
public java.lang.ObjectbuildWorkingCopyCloneFromRow(oracle.toplink.essentials.sessions.Record row, oracle.toplink.essentials.queryframework.ObjectBuildingQuery query)
By default create a new instance.

        return getDescriptor().getObjectBuilder().buildNewInstance();
    
public abstract booleanbuildsNewInstance()
Return if a new instance is created or a clone.

public java.lang.Objectclone()
INTERNAL: Clones the CopyPolicy

        try {
            // clones itself
            return super.clone();
        } catch (Exception exception) {
        }
        return null;
    
protected oracle.toplink.essentials.descriptors.ClassDescriptorgetDescriptor()
Return the descriptor.

        return descriptor;
    
public voidinitialize(oracle.toplink.essentials.sessions.Session session)
Do nothing by default.

        // Do nothing by default.
    
public voidsetDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
Set the descriptor.

        this.descriptor = descriptor;