I have a DTO with a lot of String fields (some are of other types). When mapping objects into objects of another similar class, I need to apply a transformation to all fields of type String, in this case – trim(). So, I have: What I’ve tried: Is there a way to specify all String fields of a class at
Tag: modelmapper
Issue when mapping Collection of List using ModelMapper in Spring Boot
I have a Project domain which I want to map on a ProjectDTO using modelmapper. The Project domain contains a List of Locations. In the DTO, I don’t want the Location domains, just the ids of the …
Why does ModelMapper map collections merge-style?
In my application I am mapping data transfer objects to entities using the ModelMapper library. One entity Library has a collection (java.util.Set) containing other entities Book. A user should be able to change the collections contents. In this case a data transfer object UpdateDTO is used that contains the identifiers of the entities Book to be stored in the collection.