remap icon indicating copy to clipboard operation
remap copied to clipboard

Support for hierarchy

Open italktothewind opened this issue 5 years ago • 3 comments

This is a feature proposal.

I have Pet, Dog and Cat entity classes. Dog and Cat classes extend Pet. I also have the equivalent PetDTO, DogDTO and CatDTO.

I would like to map a PetDTO entity and get a Dog or a Cat entity in return.

Very similar to this in mapstruct: https://github.com/mapstruct/mapstruct/issues/366

italktothewind avatar Jan 25 '20 02:01 italktothewind

Yes ReMap should support type hierarchy. I will analyse the mapstruct example. A while ago there was a proof-of-concept #114 maybe that is a good basis to start.

schuettec avatar Jan 25 '20 11:01 schuettec

In fact, every mapper is having issues with hierarchy (e.g. https://github.com/modelmapper/modelmapper/issues/182) so it could be a very distinctive feature for remap :)

italktothewind avatar Jan 25 '20 18:01 italktothewind

For what it's worth, I implemented a Mapper for hierarchies using a combination of updating and creating mappers, as illustrated in this StackOverflow post: https://stackoverflow.com/questions/59727793/java-mapping-dtos-hierarchy-using-mapstruct/67622805

mspronk avatar May 20 '21 14:05 mspronk