Tabnine Logo
CopyPolicy.buildClone
Code IndexAdd Tabnine to your IDE (free)

How to use
buildClone
method
in
org.eclipse.persistence.descriptors.copying.CopyPolicy

Best Java code snippets using org.eclipse.persistence.descriptors.copying.CopyPolicy.buildClone (Showing top 6 results out of 315)

origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * 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);
  }
  return clone;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * 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;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * 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;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Returns the backup clone of the specified object. This is called only from unit of work.
 * The clone sent as parameter is always a working copy from the unit of work.
 */
public Object buildBackupClone(Object clone, UnitOfWorkImpl unitOfWork) {
  // The copy policy builds clone    .
  ClassDescriptor descriptor = this.descriptor;
  Object backup = descriptor.getCopyPolicy().buildClone(clone, unitOfWork);
  // PERF: Avoid synchronized enumerator as is concurrency bottleneck.
  List mappings = getCloningMappings();
  int size = mappings.size();
  if (descriptor.hasFetchGroupManager() && descriptor.getFetchGroupManager().isPartialObject(clone)) {
    FetchGroupManager fetchGroupManager = descriptor.getFetchGroupManager();
    for (int index = 0; index < size; index++) {
      DatabaseMapping mapping = (DatabaseMapping)mappings.get(index);
      if (fetchGroupManager.isAttributeFetched(clone, mapping.getAttributeName())) {
        mapping.buildBackupClone(clone, backup, unitOfWork);
      }
    }
  } else {
    for (int index = 0; index < size; index++) {
      ((DatabaseMapping)mappings.get(index)).buildBackupClone(clone, backup, unitOfWork);
    }
  }
  return backup;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Returns the backup clone of the specified object. This is called only from unit of work.
 * The clone sent as parameter is always a working copy from the unit of work.
 */
public Object buildBackupClone(Object clone, UnitOfWorkImpl unitOfWork) {
  // The copy policy builds clone	.
  ClassDescriptor descriptor = this.descriptor;
  Object backup = descriptor.getCopyPolicy().buildClone(clone, unitOfWork);
  // PERF: Avoid synchronized enumerator as is concurrency bottleneck.
  List mappings = getCloningMappings();
  int size = mappings.size();
  if (descriptor.hasFetchGroupManager() && descriptor.getFetchGroupManager().isPartialObject(clone)) {
    FetchGroupManager fetchGroupManager = descriptor.getFetchGroupManager();
    for (int index = 0; index < size; index++) {
      DatabaseMapping mapping = (DatabaseMapping)mappings.get(index);
      if (fetchGroupManager.isAttributeFetched(clone, mapping.getAttributeName())) {
        mapping.buildBackupClone(clone, backup, unitOfWork);
      }
    }
  } else {
    for (int index = 0; index < size; index++) {
      ((DatabaseMapping)mappings.get(index)).buildBackupClone(clone, backup, unitOfWork);
    }
  }
  return backup;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Returns the backup clone of the specified object. This is called only from unit of work.
 * The clone sent as parameter is always a working copy from the unit of work.
 */
public Object buildBackupClone(Object clone, UnitOfWorkImpl unitOfWork) {
  // The copy policy builds clone	.
  ClassDescriptor descriptor = this.descriptor;
  Object backup = descriptor.getCopyPolicy().buildClone(clone, unitOfWork);
  // PERF: Avoid synchronized enumerator as is concurrency bottleneck.
  List mappings = getCloningMappings();
  int size = mappings.size();
  if (descriptor.hasFetchGroupManager() && descriptor.getFetchGroupManager().isPartialObject(clone)) {
    FetchGroupManager fetchGroupManager = descriptor.getFetchGroupManager();
    for (int index = 0; index < size; index++) {
      DatabaseMapping mapping = (DatabaseMapping)mappings.get(index);
      if (fetchGroupManager.isAttributeFetched(clone, mapping.getAttributeName())) {
        mapping.buildBackupClone(clone, backup, unitOfWork);
      }
    }
  } else {
    for (int index = 0; index < size; index++) {
      ((DatabaseMapping)mappings.get(index)).buildBackupClone(clone, backup, unitOfWork);
    }
  }
  return backup;
}
org.eclipse.persistence.descriptors.copyingCopyPolicybuildClone

Javadoc

Return a shallow clone of the object for usage with object copying, or unit of work backup cloning.

Popular methods of CopyPolicy

  • buildWorkingCopyClone
    Return a shallow clone of the object for usage with the unit of work working copy.
  • buildWorkingCopyCloneFromRow
    Return an instance with the primary key set from the row, used for building a working copy during a
  • buildsNewInstance
    Return if this copy policy creates a new instance, vs a clone.
  • clone
    Clone the CopyPolicy.
  • initialize
    Allow for any initialization or validation required.
  • setDescriptor
    Set the descriptor.
  • buildWorkingCopyCloneFromPrimaryKeyObject
    Return an instance with the primary key, used for building a working copy during a unit of work tran

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Collectors (java.util.stream)
  • Notification (javax.management)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now