java.lang.Object
software.xdev.spring.data.eclipse.store.repository.support.copier.working.RecursiveWorkingCopier<T>
All Implemented Interfaces:
WorkingCopier<T>

public class RecursiveWorkingCopier<T> extends Object implements WorkingCopier<T>
Creates copies and puts them back. Recognizes already persisted Objects and checks them for changes as well.
  • Constructor Details

  • Method Details

    • copy

      public T copy(T objectToCopy)
      Description copied from interface: WorkingCopier
      Creates a new instance of the given object and registers it in the WorkingCopyRegistry.
      Specified by:
      copy in interface WorkingCopier<T>
      Returns:
      new instance of the object
    • copy

      public <L extends Collection<T>> L copy(L objectCollectionToCopy)
      Description copied from interface: WorkingCopier
      Creates new instances of each element of the given collection and registers it in the WorkingCopyRegistry.
      Specified by:
      copy in interface WorkingCopier<T>
      Returns:
      new collection with new instances
    • mergeBack

      public WorkingCopierResult<T> mergeBack(T workingCopy)
      Description copied from interface: WorkingCopier
      Merges the values of the given object back into the original object from the date store.
      Specified by:
      mergeBack in interface WorkingCopier<T>
      Parameters:
      workingCopy - to merge back into the original object
      Returns:
      all the changed objects that must get stored
    • getOrCreateObjectForDatastore

      public <E> E getOrCreateObjectForDatastore(E workingCopy, boolean mergeValues, MergedTargetsCollector alreadyMergedTargets, ChangedObjectCollector changedCollector)
    • getOriginal

      public T getOriginal(T workingCopy)
      Specified by:
      getOriginal in interface WorkingCopier<T>
      Returns:
      the original entity that corresponds to the given working copy object.
    • onlyCreateCopy

      public <E> E onlyCreateCopy(E objectToCopy, boolean invertRegistry)
      Specified by:
      onlyCreateCopy in interface WorkingCopier<T>
    • deregister

      public void deregister(T workingCopy)
      Description copied from interface: WorkingCopier
      Unregister the working copy object from the WorkingCopyRegistry.
      Specified by:
      deregister in interface WorkingCopier<T>