Type Parameters:
T - class of the object that will get copied
All Known Implementing Classes:
RecursiveWorkingCopier

public interface WorkingCopier<T>
Creates, registers and deregisters Instances of working copies. Working copies are object instances that are a copy of the objects in the actual datastore.
  • Method Details

    • copy

      T copy(T objectToCopy)
      Creates a new instance of the given object and registers it in the WorkingCopyRegistry.
      Returns:
      new instance of the object
    • copy

      <L extends Collection<T>> L copy(L objectCollectionToCopy)
      Creates new instances of each element of the given collection and registers it in the WorkingCopyRegistry.
      Returns:
      new collection with new instances
    • mergeBack

      WorkingCopierResult<T> mergeBack(T workingCopy)
      Merges the values of the given object back into the original object from the date store.
      Parameters:
      workingCopy - to merge back into the original object
      Returns:
      all the changed objects that must get stored
    • onlyCreateCopy

      <E> E onlyCreateCopy(E objectToCopy, boolean invertRegistry)
    • getOriginal

      T getOriginal(T workingCopy)
      Returns:
      the original entity that corresponds to the given working copy object.
    • deregister

      void deregister(T workingCopy)
      Unregister the working copy object from the WorkingCopyRegistry.