Class UserUserRelationMergeHandler
java.lang.Object
ch.tocco.nice2.entityoperation.spi.merge.ToManyRelationMergeHandler
ch.tocco.nice2.optional.address.impl.merge.AbstractAddressAddressAndUserUserRelationMergeHandler
ch.tocco.nice2.optional.address.impl.merge.UserUserRelationMergeHandler
- All Implemented Interfaces:
RelationMergeHandler
@Component
public class UserUserRelationMergeHandler
extends AbstractAddressAddressAndUserUserRelationMergeHandler
Custom
for User→User_user relations.
This handler removes potential duplicates if multiple source users have a relation
to the same user.
This is necessary to avoid a validation error (see
).
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.
invalid reference
RelationMergeHandler
invalid reference
EqualUserUserEntityExistsValidator
-
Constructor Summary
ConstructorDescriptionUserUserRelationMergeHandler
(TextResources textResources, SecurityManager securityManager, BusinessUnitManager businessUnitManager, DeleteService deleteService, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionprotected Entity
getCodeEntity
(Entity entity) protected String
protected Entity
getRelatedEntity
(Entity entity, RelationModel relationModel) boolean
supports
(RelationModel relationModel) Methods inherited from class ch.tocco.nice2.optional.address.impl.merge.AbstractAddressAddressAndUserUserRelationMergeHandler
mergeRelation, priority
-
Constructor Details
-
UserUserRelationMergeHandler
public UserUserRelationMergeHandler(TextResources textResources, SecurityManager securityManager, BusinessUnitManager businessUnitManager, DeleteService deleteService, PersistenceService persistenceService)
-
-
Method Details
-
supports
- Specified by:
supports
in interfaceRelationMergeHandler
- Overrides:
supports
in classToManyRelationMergeHandler
- Returns:
- true if this handler supports merging the given relation model
-
getRelatedEntity
- Specified by:
getRelatedEntity
in classAbstractAddressAddressAndUserUserRelationMergeHandler
-
getEntityName
- Specified by:
getEntityName
in classAbstractAddressAddressAndUserUserRelationMergeHandler
-
getCodeEntity
- Specified by:
getCodeEntity
in classAbstractAddressAddressAndUserUserRelationMergeHandler
-