Class LogicCopyServiceImpl
java.lang.Object
ch.tocco.nice2.entityoperation.impl.logiccopy.LogicCopyServiceImpl
- All Implemented Interfaces:
- LogicCopyService
- 
Constructor SummaryConstructorsConstructorDescriptionLogicCopyServiceImpl(QueryBuilderFactory queryBuilderFactory, TextResources textResources, Context context, L10N l10N, EntityDefaultValueService defaultValueService) 
- 
Method SummaryModifier and TypeMethodDescriptioncopyRelations(Entity copiedEntity, Entity originalEntity, Collection<String> excluded) same asLogicCopyService.copyRelations(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.
- 
Constructor Details- 
LogicCopyServiceImplpublic LogicCopyServiceImpl(QueryBuilderFactory queryBuilderFactory, TextResources textResources, Context context, L10N l10N, EntityDefaultValueService defaultValueService) 
 
- 
- 
Method Details- 
createLogicCopyOfDescription copied from interface:LogicCopyServicegives 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:
- createLogicCopyOfin interface- LogicCopyService
- Parameters:
- originalEntity- entity to copy
- Returns:
- copied entity
 
- 
copyRelationspublic Entity copyRelations(Entity copiedEntity, Entity originalEntity, Collection<String> excluded) Description copied from interface:LogicCopyServicesame asLogicCopyService.copyRelations(Entity, Entity, Optional, Collection)but passes an absent optional for the third parameter (parentEntity)- Specified by:
- copyRelationsin 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
 
- 
copyRelationspublic Entity copyRelations(Entity copiedEntity, Entity originalEntity, Optional<Entity> parentEntity, Collection<String> excluded) Description copied from interface:LogicCopyServicecopies 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:
- copyRelationsin 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
 
 
-