Class LogicCopyServiceImpl

java.lang.Object
ch.tocco.nice2.entityoperation.impl.logiccopy.LogicCopyServiceImpl
All Implemented Interfaces:
LogicCopyService

@Component public class LogicCopyServiceImpl extends Object implements LogicCopyService
  • Constructor Details

  • Method Details

    • createLogicCopyOf

      public LogicCopyExecutor createLogicCopyOf(Entity originalEntity)
      Description copied from interface: LogicCopyService
      gives you a complete Copy of the given entity with all relations. the fluent interface can be used to define the copy behaviour. Example: logicCopyService.createLogicCopyOf(subproject).withRelatedEntitiesToCopy(ImmutableSet.of(relTask)) .withExcludedRelations(ImmutableSet.of(relTask.relTask_note)).doCopy()
      Specified by:
      createLogicCopyOf in interface LogicCopyService
      Parameters:
      originalEntity - entity to copy
      Returns:
      copied entity
    • copyRelations

      public Entity copyRelations(Entity copiedEntity, Entity originalEntity, Collection<String> excluded)
      Description copied from interface: LogicCopyService
      same as LogicCopyService.copyRelations(Entity, Entity, Optional, Collection) but passes an absent optional for the third parameter (parentEntity)
      Specified by:
      copyRelations in interface LogicCopyService
      Parameters:
      copiedEntity - the entity to copy the relations to
      originalEntity - entity to get the relation values from
      excluded - list of relations which should be excluded from copy
    • copyRelations

      public Entity copyRelations(Entity copiedEntity, Entity originalEntity, Optional<Entity> parentEntity, Collection<String> excluded)
      Description copied from interface: LogicCopyService
      copies the references of relations that: - are not the parentEntity if one exists - are not 1:n from the view of the original entity (as this would modify the original entity) - are not excluded. (note that the related entities will not get copied!)
      Specified by:
      copyRelations in interface LogicCopyService
      Parameters:
      copiedEntity - the entity to copy the relations to
      originalEntity - entity to get the relation values from
      parentEntity - parent to ignore
      excluded - list of relations which should be excluded from copy