Class AbstractAddressAddressAndUserUserRelationMergeHandler
java.lang.Object
ch.tocco.nice2.entityoperation.spi.merge.ToManyRelationMergeHandler
ch.tocco.nice2.optional.address.impl.merge.AbstractAddressAddressAndUserUserRelationMergeHandler
- All Implemented Interfaces:
RelationMergeHandler
- Direct Known Subclasses:
AddressAddressRelationMergeHandler
,UserUserRelationMergeHandler
public abstract class AbstractAddressAddressAndUserUserRelationMergeHandler
extends ToManyRelationMergeHandler
Abstract
RelationMergeHandler
for Address->Address_address and User->User_user relations.
This handler removes potential duplicates if multiple source entities have a relation
to the same entity.
This is necessary to avoid a validation error.
If there are duplicates it is important to remove the 'new' value and keep the existing one,
because the validator uses a query to compare uniqueness.-
Constructor Summary
ConstructorDescriptionAbstractAddressAddressAndUserUserRelationMergeHandler
(TextResources textResources, SecurityManager securityManager, BusinessUnitManager businessUnitManager, DeleteService deleteService, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Entity
getCodeEntity
(Entity entity) protected abstract String
protected abstract Entity
getRelatedEntity
(Entity entity, RelationModel relationModel) mergeRelation
(RelationMergeContext mergeContext) Merges the relation into the target entity.int
priority()
The priority can be used to override the default handlers by using a higher priority than the default which is 0Methods inherited from class ch.tocco.nice2.entityoperation.spi.merge.ToManyRelationMergeHandler
supports
-
Constructor Details
-
AbstractAddressAddressAndUserUserRelationMergeHandler
public AbstractAddressAddressAndUserUserRelationMergeHandler(TextResources textResources, SecurityManager securityManager, BusinessUnitManager businessUnitManager, DeleteService deleteService, PersistenceService persistenceService)
-
-
Method Details
-
mergeRelation
Description copied from interface:RelationMergeHandler
Merges the relation into the target entity.- Specified by:
mergeRelation
in interfaceRelationMergeHandler
- Overrides:
mergeRelation
in classToManyRelationMergeHandler
- Parameters:
mergeContext
- contains the necessary data to perform the merge operation (like relation model and target entity)- Returns:
- merge result (for example skipped entities)
-
priority
public int priority()Description copied from interface:RelationMergeHandler
The priority can be used to override the default handlers by using a higher priority than the default which is 0- Returns:
- the priority of this handler.
-
getRelatedEntity
-
getEntityName
-
getCodeEntity
-