/** * Returns the clone of the specified object. This is called only from unit of work. * This only instantiates the clone instance, it does not clone the attributes, * this allows the stub of the clone to be registered before cloning its parts. */ public Object instantiateClone(Object domainObject, AbstractSession session) { Object clone = this.descriptor.getCopyPolicy().buildClone(domainObject, session); // Clear change tracker. if (clone instanceof ChangeTracker) { ((ChangeTracker)clone)._persistence_setPropertyChangeListener(null); } if(clone instanceof FetchGroupTracker) { ((FetchGroupTracker)clone)._persistence_setFetchGroup(null); ((FetchGroupTracker)clone)._persistence_setSession(null); } clearPrimaryKey(clone); return clone; }
/** * Returns the clone of the specified object. This is called only from unit of work. * This only instantiates the clone instance, it does not clone the attributes, * this allows the stub of the clone to be registered before cloning its parts. */ public Object instantiateClone(Object domainObject, AbstractSession session) { Object clone = this.descriptor.getCopyPolicy().buildClone(domainObject, session); // Clear change tracker. if (clone instanceof ChangeTracker) { ((ChangeTracker)clone)._persistence_setPropertyChangeListener(null); } if(clone instanceof FetchGroupTracker) { ((FetchGroupTracker)clone)._persistence_setFetchGroup(null); ((FetchGroupTracker)clone)._persistence_setSession(null); } clearPrimaryKey(clone); return clone; }
objectBuilder.mergeChangesIntoObject(original, objectChangeSet, clone, this, !descriptor.getCopyPolicy().buildsNewInstance()); objectBuilder.clearPrimaryKey(original); objectBuilder.clearPrimaryKey(original);