/** * PUBLIC: * Specifies that the creation of clones within a unit of work is done by * sending the cloneMethodName method to the original object. This method * must return a logical shallow copy of the original object. * This can be used if the default mechanism of creating a new instance * does not handle the object's non-persistent attributes correctly. * * @see #useCloneCopyPolicy() */ public void useCloneCopyPolicy(String cloneMethodName) { CloneCopyPolicy policy = new CloneCopyPolicy(); policy.setMethodName(cloneMethodName); setCopyPolicy(policy); }
/** * PUBLIC: * Specifies that the creation of clones within a unit of work is done by * sending the cloneMethodName method to the original object. This method * must return a logical shallow copy of the original object. * This can be used if the default mechanism of creating a new instance * does not handle the object's non-persistent attributes correctly. * * @see #useCloneCopyPolicy() */ public void useCloneCopyPolicy(String cloneMethodName) { CloneCopyPolicy policy = new CloneCopyPolicy(); policy.setMethodName(cloneMethodName); setCopyPolicy(policy); }
/** * PUBLIC: * Specifies that the creation of clones within a unit of work is done by * sending the cloneMethodName method to the original object. This method * must return a logical shallow copy of the original object. * This can be used if the default mechanism of creating a new instance * does not handle the object's non-persistent attributes correctly. * * @see #useCloneCopyPolicy() */ public void useCloneCopyPolicy(String cloneMethodName) { CloneCopyPolicy policy = new CloneCopyPolicy(); policy.setMethodName(cloneMethodName); setCopyPolicy(policy); }
/** * INTERNAL: */ public CopyPolicy getCopyPolicy() { if (methodName == null && workingCopyMethodName == null){ throw ValidationException.copyPolicyMustSpecifyEitherMethodOrWorkingCopyMethod(getLocation()); } CloneCopyPolicy copyPolicy = new CloneCopyPolicy(); copyPolicy.setMethodName(methodName); copyPolicy.setWorkingCopyMethodName(workingCopyMethodName); return copyPolicy; }