Task #978
closedDto mappers - new layer
100%
Description
We need to build new layer, which will be responsible for converting entities to dtos (and reverse). We have this conversion defined directly in all service implementetions (AbstractReadWriteDtoService) and this brings this issues:
- our conversion isn't called for embedded entities (standard mapper conversion is used there) - this can lead to really unpredicted behavior (e.g. #969)
- we cannot call conversions manually - conversion is defined in implementation of AbstractReadWriteDtoService not in interface. We need to call transformations independently by services for diferrent entities (e.g. see workaround in DefaultIdmAutomaticRoleAttributeService#getIdentitiesForAutomaticRole).
Solution:
- dto mappers will be registered the same way as dto lookups (with same benefits)
- dto mapper manager will be created the same way as LookupService (with same benefits)
- manager will be injected into services (respectively in AbstractReadWriteDtoService) and called in current 'toDto' and 'toEntity' methods
- manager will be injected and used in ModelMapperConfig configuration.
Related issues