Class CloneCopyPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, CopyPolicy

    public class CloneCopyPolicy
    extends AbstractCopyPolicy

    Purpose: Allows a clone of an object to be created with a method that returns the cloned object. It is possible to define methods for two types of clones 1. methodName can be set to define the method EclipseLink uses to clone objects for it's own internal use. The objects created by this method will not be visible to the user, and instead used as a basis for comparison when a DeferredChangeDetectionPolicy used. This method will also be in place of the workingCopyMethod if it is not provided 2. workingCopyMethod this method is used to create the clone that is returned to the user when an Object is registered in a UnitOfWork

    See Also:
    Serialized Form
    • Field Detail

      • methodName

        protected java.lang.String methodName
        Allow for clone method to be specified.
      • workingCopyMethodName

        protected java.lang.String workingCopyMethodName
      • method

        protected transient java.lang.reflect.Method method
      • workingCopyMethod

        protected transient java.lang.reflect.Method workingCopyMethod
    • Constructor Detail

      • CloneCopyPolicy

        public CloneCopyPolicy()
    • Method Detail

      • getMethod

        protected java.lang.reflect.Method getMethod()
        Return the clone method.
      • getMethodName

        public java.lang.String getMethodName()
        Return the clone method name.
      • getWorkingCopyMethod

        protected java.lang.reflect.Method getWorkingCopyMethod()
        Return the workingCopyClone method. This is used to clone within a unit of work.
      • getWorkingCopyMethodName

        public java.lang.String getWorkingCopyMethodName()
        Return the workingCopyClone method name. This is used to clone within a unit of work.
      • setMethod

        protected void setMethod​(java.lang.reflect.Method method)
        Set the clone method.
      • setMethodName

        public void setMethodName​(java.lang.String methodName)
        Set the clone method name.
      • setWorkingCopyMethod

        protected void setWorkingCopyMethod​(java.lang.reflect.Method method)
        Set the workingCopyClone method. This is used to clone within a unit of work.
      • setWorkingCopyMethodName

        public void setWorkingCopyMethodName​(java.lang.String methodName)
        Set the workingCopyClone method name. This is used to clone within a unit of work.
      • buildsNewInstance

        public boolean buildsNewInstance()
        Return false as a shallow clone is returned, not a new instance.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object