Interface LogicCopyService
- All Known Implementing Classes:
LogicCopyServiceImpl
public interface LogicCopyService
-
Method Summary
Modifier and TypeMethodDescriptioncopyRelations
(Entity copiedEntity, Entity originalEntity, Collection<String> excluded) same ascopyRelations(Entity, Entity, Optional, Collection)
but passes an absent optional for the third parameter (parentEntity)copyRelations
(Entity copiedEntity, Entity originalEntity, Optional<Entity> parentEntity, Collection<String> excluded) 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.createLogicCopyOf
(Entity originalEntity) gives you a complete Copy of the given entity with all relations.
-
Method Details
-
createLogicCopyOf
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()- Parameters:
originalEntity
- entity to copy- Returns:
- copied entity
-
copyRelations
same ascopyRelations(Entity, Entity, Optional, Collection)
but passes an absent optional for the third parameter (parentEntity)- Parameters:
copiedEntity
- the entity to copy the relations tooriginalEntity
- entity to get the relation values fromexcluded
- list of relations which should be excluded from copy
-
copyRelations
Entity copyRelations(Entity copiedEntity, Entity originalEntity, Optional<Entity> parentEntity, Collection<String> excluded) 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!)- Parameters:
copiedEntity
- the entity to copy the relations tooriginalEntity
- entity to get the relation values fromparentEntity
- parent to ignoreexcluded
- list of relations which should be excluded from copy
-