Project

General

Profile

Task #978

Dto mappers - new layer

Added by Radek Tomiška over 3 years ago. Updated 29 days ago.

Status:
Closed
Priority:
High
Category:
Spring - DATA
Target version:
Start date:
02/21/2018
Due date:
% Done:

100%

Estimated time:
Milestones:

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

Related to CzechIdM - Task #1247: Info components - optimize number of request to backendClosed09/10/2018

Related to CzechIdM - Task #2763: Audit: Show info card with revision for deleted entities (uuid is show now only)Closed04/19/2021

Related to CzechIdM - Defect #2975: Audit: Handle exception in audit, when referenced entity not found (for entities with Not Found - ignore annotation)Closed10/06/2021

Precedes CzechIdM - Defect #969: EntityToUuidConverter failed to convert eu.bcvsolutions.idm.core.model.entity.IdmIdentity to java.util.UUID.Closed

History

#1 Updated by Radek Tomiška over 3 years ago

  • Precedes Defect #969: EntityToUuidConverter failed to convert eu.bcvsolutions.idm.core.model.entity.IdmIdentity to java.util.UUID. added

#2 Updated by Radek Tomiška about 3 years ago

  • Related to Task #1247: Info components - optimize number of request to backend added

#3 Updated by Radek Tomiška 3 months ago

  • Target version set to 11.2.0

#5 Updated by Radek Tomiška 2 months ago

  • Status changed from New to In Progress

#6 Updated by Radek Tomiška 2 months ago

  • Related to Task #2763: Audit: Show info card with revision for deleted entities (uuid is show now only) added

#7 Updated by Radek Tomiška 2 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 90

New layer is implemented and is used from model mapper converters, aduit and for converting owner into eav form values.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/66c946c35215a31d6a05e0f028d3fbdabeb7e5ac
+ api improvements to implement custom dto mapper easier with context is available (and used for form values):
https://github.com/bcvsolutions/CzechIdMng/commit/2fef2f0fde842a3819f3561909a5f7fee57622a7

Could you provide me a feedback, please?

#8 Updated by Vít Švanda about 2 months ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 90 to 100

I did review and tested it. Nice feature, that can solve many hidden problems. Thanks for that.

#9 Updated by Radek Tomiška 29 days ago

  • Status changed from Resolved to Closed

#10 Updated by Radek Tomiška 16 days ago

  • Related to Defect #2975: Audit: Handle exception in audit, when referenced entity not found (for entities with Not Found - ignore annotation) added

Also available in: Atom PDF

Go to top