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
ConstructorsConstructorDescriptionAbstractAddressAddressAndUserUserRelationMergeHandler(TextResources textResources, SecurityManager securityManager, BusinessUnitManager businessUnitManager, DeleteService deleteService, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EntitygetCodeEntity(Entity entity) protected abstract Stringprotected abstract EntitygetRelatedEntity(Entity entity, RelationModel relationModel) mergeRelation(RelationMergeContext mergeContext) Merges the relation into the target entity.intpriority()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:RelationMergeHandlerMerges the relation into the target entity.- Specified by:
mergeRelationin interfaceRelationMergeHandler- Overrides:
mergeRelationin 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:RelationMergeHandlerThe 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
-