Interface LogicCopyExecutor
public interface LogicCopyExecutor
-
Method Summary
Modifier and TypeMethodDescriptionaddSuffixToLabel
(boolean addSuffix) control whether a suffix should be added to the label field or not.default Entity
doCopy()
doCopy
(BiConsumer<Entity, Entity> resultConsumer) copy the entity based on previous configurationwithExcludedFields
(Collection<String> fieldsToExclude) exclude fields from being copiedwithExcludedRelation
(String relationToExclude) exclude n:0..1 (and if absolutely necessary n:1) relation from being related to the newly copied entity if excluding n:1 relation be sure to set it manually!withExcludedRelations
(Collection<String> relationsToExclude) exclude n:0..1 (and if absolutely necessary n:1) relations from being related to the newly copied entity if excluding n:1 relations be sure to set them manually!withParent
(@Nullable Entity parent) define a parent which won't be copiedwithRelatedEntitiesToCopy
(String relationToCopy) define a n:1 relation which should be copiedwithRelatedEntitiesToCopy
(Collection<String> relationsToCopy) define the related n:1 entities which should be copiedwithRelatedEntitiesToCopy
(Map<String, List<String>> relationsToCopy) same behaviour as $withRelatedEntitiesToCopy(Collection)
except that the List of the map can be used to exclude some fields on the entity to copy
-
Method Details
-
withParent
define a parent which won't be copied- Parameters:
parent
- the entity to ignore from the copy
-
withRelatedEntitiesToCopy
define a n:1 relation which should be copied- Parameters:
relationToCopy
- path to the entities to copy
-
withRelatedEntitiesToCopy
define the related n:1 entities which should be copied- Parameters:
relationsToCopy
- paths to the entities to copy
-
withRelatedEntitiesToCopy
same behaviour as $withRelatedEntitiesToCopy(Collection)
except that the List of the map can be used to exclude some fields on the entity to copy -
withExcludedRelation
exclude n:0..1 (and if absolutely necessary n:1) relation from being related to the newly copied entity if excluding n:1 relation be sure to set it manually!- Parameters:
relationToExclude
- relation which should not be related
-
withExcludedRelations
exclude n:0..1 (and if absolutely necessary n:1) relations from being related to the newly copied entity if excluding n:1 relations be sure to set them manually!- Parameters:
relationsToExclude
- list of relations which should not be related
-
withExcludedFields
exclude fields from being copied- Parameters:
fieldsToExclude
- list of fields which should be excluded
-
addSuffixToLabel
control whether a suffix should be added to the label field or not. By default it's set to true. -
doCopy
- See Also:
-
doCopy
copy the entity based on previous configuration- Parameters:
resultConsumer
- a consumer that gets passed each original entity with its copy, through all relations- Returns:
- the copied entity
-