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
| Modifier and Type | Field and Description |
|---|---|
| protected transient Method | |
| protected String | methodName
Allow for clone method to be specified. |
| protected transient Method | |
| protected String |
| Access | Constructor and Description |
|---|---|
| public |
| method | back to summary |
|---|---|
| protected transient Method method | |
| methodName | back to summary |
|---|---|
| protected String methodName Allow for clone method to be specified. | |
| workingCopyMethod | back to summary |
|---|---|
| protected transient Method workingCopyMethod | |
| workingCopyMethodName | back to summary |
|---|---|
| protected String workingCopyMethodName | |
| CloneCopyPolicy | back to summary |
|---|---|
| public CloneCopyPolicy() | |
| buildClone | back to summary |
|---|---|
| public Object buildClone(Object domainObject, Session session) throws DescriptorException Implements abstract org. Implements org. Clone through calling the clone method.
| |
| buildsNewInstance | back to summary |
|---|---|
| public boolean buildsNewInstance() Implements org. Return false as a shallow clone is returned, not a new instance.
| |
| buildWorkingCopyClone | back to summary |
|---|---|
| public Object buildWorkingCopyClone(Object domainObject, Session session) throws DescriptorException Overrides org. Implements org. Clone through the workingCopyClone method, or if not specified the clone method.
| |
| buildWorkingCopyCloneFromRow | back to summary |
|---|---|
| public Object buildWorkingCopyCloneFromRow(DataRecord row, ObjectBuildingQuery query, Object primaryKey, UnitOfWork uow) throws DescriptorException Overrides org. Implements org. Create a new instance, unless a workingCopyClone method is specified, then build a new instance and clone it.
| |
| getMethod | back to summary |
|---|---|
| protected Method getMethod() Return the clone method. | |
| getMethodName | back to summary |
|---|---|
| public String getMethodName() Return the clone method name. | |
| getWorkingCopyMethod | back to summary |
|---|---|
| protected Method getWorkingCopyMethod() Return the workingCopyClone method. This is used to clone within a unit of work. | |
| getWorkingCopyMethodName | back to summary |
|---|---|
| public String getWorkingCopyMethodName() Return the workingCopyClone method name. This is used to clone within a unit of work. | |
| initialize | back to summary |
|---|---|
| public void initialize(Session session) throws DescriptorException Overrides org. Implements org. Validate and build the methods.
| |
| setMethod | back to summary |
|---|---|
| protected void setMethod(Method method) Set the clone method. | |
| setMethodName | back to summary |
|---|---|
| public void setMethodName(String methodName) Set the clone method name. | |
| setWorkingCopyMethod | back to summary |
|---|---|
| protected void setWorkingCopyMethod(Method method) Set the workingCopyClone method. This is used to clone within a unit of work. | |
| setWorkingCopyMethodName | back to summary |
|---|---|
| public void setWorkingCopyMethodName(String methodName) Set the workingCopyClone method name. This is used to clone within a unit of work. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |