Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify MapStruct Subclass Mappings #106

Open
4 tasks
raffaelfoidl opened this issue Jun 9, 2022 · 0 comments
Open
4 tasks

Simplify MapStruct Subclass Mappings #106

raffaelfoidl opened this issue Jun 9, 2022 · 0 comments
Labels

Comments

@raffaelfoidl
Copy link
Member

Description
Up until version MapStruct version 1.4.2, subclass (downcast) mappings had to be implemented manually using instanceof checks. This has been a longstanding missing feature. A corresponding PR (mapstruct/mapstruct#2512) has been merged in October 2021 and made it into the release of 1.5.0.Beta2 (https://github.com/mapstruct/mapstruct/releases/tag/1.5.0.Beta2).

Since witness strives to rely on stable dependencies only, 1.5.0.Final (https://github.com/mapstruct/mapstruct/releases/tag/1.5.0.Final) is the first acceptable version shipping with the desired type refinement feature.

Related Problem
Due to partly complicated inheritance hierarchies, mapping between DTO and entity objects needs special handling with MapStruct. This issue applies to SetLogMapper (createDtoToEntity, dtoToEntity, entityToDto) and ExerciseMapper (entitiesToDtos and, by extension, entityToDtoTypeAware`).

Acceptance Criteria

Note: The existing test infrastructure should cover all the changes introduced by this task. Therefore, the required modifications should be able to act as mapper-internal implementation specifics. This means no new test cases are required by this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant