|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.descriptors.copying.AbstractCopyPolicy org.eclipse.persistence.descriptors.copying.CloneCopyPolicy
public class CloneCopyPolicy
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
Field Summary | |
---|---|
protected java.lang.reflect.Method |
method
|
protected java.lang.String |
methodName
Allow for clone method to be specified. |
protected java.lang.reflect.Method |
workingCopyMethod
|
protected java.lang.String |
workingCopyMethodName
|
Fields inherited from class org.eclipse.persistence.descriptors.copying.AbstractCopyPolicy |
---|
descriptor |
Constructor Summary | |
---|---|
CloneCopyPolicy()
|
Method Summary | |
---|---|
java.lang.Object |
buildClone(java.lang.Object domainObject,
Session session)
Clone through calling the clone method. |
boolean |
buildsNewInstance()
Return false as a shallow clone is returned, not a new instance. |
java.lang.Object |
buildWorkingCopyClone(java.lang.Object domainObject,
Session session)
Clone through the workingCopyClone method, or if not specified the clone method. |
java.lang.Object |
buildWorkingCopyCloneFromRow(Record row,
ObjectBuildingQuery query,
java.lang.Object primaryKey,
UnitOfWork uow)
Create a new instance, unless a workingCopyClone method is specified, then build a new instance and clone it. |
protected java.lang.reflect.Method |
getMethod()
Return the clone method. |
java.lang.String |
getMethodName()
Return the clone method name. |
protected java.lang.reflect.Method |
getWorkingCopyMethod()
Return the workingCopyClone method. |
java.lang.String |
getWorkingCopyMethodName()
Return the workingCopyClone method name. |
void |
initialize(Session session)
Validate and build the methods. |
protected void |
setMethod(java.lang.reflect.Method method)
Set the clone method. |
void |
setMethodName(java.lang.String methodName)
Set the clone method name. |
protected void |
setWorkingCopyMethod(java.lang.reflect.Method method)
Set the workingCopyClone method. |
void |
setWorkingCopyMethodName(java.lang.String methodName)
Set the workingCopyClone method name. |
java.lang.String |
toString()
|
Methods inherited from class org.eclipse.persistence.descriptors.copying.AbstractCopyPolicy |
---|
clone, getDescriptor, setDescriptor |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String methodName
protected java.lang.String workingCopyMethodName
protected transient java.lang.reflect.Method method
protected transient java.lang.reflect.Method workingCopyMethod
Constructor Detail |
---|
public CloneCopyPolicy()
Method Detail |
---|
public java.lang.Object buildClone(java.lang.Object domainObject, Session session) throws DescriptorException
buildClone
in interface CopyPolicy
buildClone
in class AbstractCopyPolicy
DescriptorException
public java.lang.Object buildWorkingCopyClone(java.lang.Object domainObject, Session session) throws DescriptorException
buildWorkingCopyClone
in interface CopyPolicy
buildWorkingCopyClone
in class AbstractCopyPolicy
DescriptorException
public java.lang.Object buildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query, java.lang.Object primaryKey, UnitOfWork uow) throws DescriptorException
buildWorkingCopyCloneFromRow
in interface CopyPolicy
buildWorkingCopyCloneFromRow
in class AbstractCopyPolicy
DescriptorException
protected java.lang.reflect.Method getMethod()
public java.lang.String getMethodName()
protected java.lang.reflect.Method getWorkingCopyMethod()
public java.lang.String getWorkingCopyMethodName()
public void initialize(Session session) throws DescriptorException
initialize
in interface CopyPolicy
initialize
in class AbstractCopyPolicy
DescriptorException
protected void setMethod(java.lang.reflect.Method method)
public void setMethodName(java.lang.String methodName)
protected void setWorkingCopyMethod(java.lang.reflect.Method method)
public void setWorkingCopyMethodName(java.lang.String methodName)
public boolean buildsNewInstance()
public java.lang.String toString()
toString
in class java.lang.Object
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |