Top "Mapstruct" questions

MapStruct is a code generator for creating efficient, type-safe bean-to-bean mappings in Java.

How to map nested collections using MapStruct?

I have 2 entities: Entity 1: public class Master { private int id; private Set<SubMaster> subMasters= new HashSet<SubMaster&…

java collections mapstruct
Mapping nested object with mapstruct

i create mapping like below. How to map flat dto object properties like (street, city, etc) to nested address in …

java spring mapstruct
MapStruct: Mapping 2 objects to a 3rd one

I have Object1 and Object2. Now, I want to map object3, with attributes from 1 & 2. Say, I have 2 object: 1. User: {…

java object-object-mapping mapstruct
How can I map properties conditionally with MapStruct 1.2?

Is it possible with MapStruct 1.2 to map a source property with a specific value to a specific different value in …

mapping conditional mapstruct
Mapstruct - Ambiguous mapping methods found for mapping property

I am using mapstruct to map from one DTO to another. I have multiple default methods , but 2 of them with …

java mapstruct
Autowiring inside abstract class made for mapstruct

I am trying to build a REST Controller using Spring. To format the data for readability and more integration, I …

java spring rest abstract-class mapstruct
Proper way of using and testing generated mapper

Recently we encountered some conflict during the development of our system. We discovered, that we have 3 different approaches to testing …

java unit-testing mocking mapping mapstruct
exclude specific fields in mapstruct

While I am trying to create a mapper between two classes in mapstruct, I am getting a warning when I …

java mapping mapstruct
Mapstruct LocalDateTime to Instant

I am new in Mapstruct. I have a model object which includes LocalDateTime type field. DTO includes Instant type field. …

java-time mapstruct datetime-conversion localdate java.time.instant
Map a dto to an entity retrieved from database if Dto has Id using MapStruct

I'm using MapStruct to make dto <-> entity mapping. The same mappers are used to create and update …

java mapping data-transfer-objects mapstruct