Top "Mapstruct" questions

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

Map custom method mapper to Mapstruct

I'm creating a poc for using Mapstruct in my future projects. Now I have one question how to map custom …

java mapstruct
Mapstruct - How can I inject a spring dependency in the Generated Mapper class

I need to inject a spring service class in the generated mapper implementation, so that I can use it via @…

spring mapstruct
MapStruct and Lombok not working together

Tech Stack being used : Java 8 MapStruct : 1.2.0.Final Lombok: 1.16.18 IDE: IntelliJ - Lombok Plugin already installed Initially, I faced issues when …

maven intellij-idea lombok mapstruct intellij-lombok-plugin
MapStruct requires Impl class

I have next classes: Mapper public interface DeviceTokensMapper { DeviceTokensMapper INSTANCE = Mappers.getMapper(DeviceTokensMapper.class); @Mappings({ @Mapping(source = "tokenName", target = "tokenName"), @…

java spring mapstruct
MapStruct implementation is not working in Spring Boot Web Application

I am a newbie to Spring Boot and MapStruct Tool. Earlier, A Project(written by other team using these technologies) …

spring-boot entity dto mapstruct
Mapstruct: Ignore specific field only for collection mapping

I am using following mapper to map entities: public interface AssigmentFileMapper { AssigmentFileDTO assigmentFileToAssigmentFileDTO(AssigmentFile assigmentFile); AssigmentFile assigmentFileDTOToAssigmentFile(AssigmentFileDTO assigmentFileDTO); @Mapping(…

java mapping mapstruct
MapStruct QualifiedByName with multiple parameters

I have come across a situation where my mapping method has 3 parameters, and all the three are being used in …

java intellij-idea java-8 mapstruct
MapStruct: Map List of objects, when object is mapped from two objects

Assume I have such mapping: @Mapping(source = "parentId", target = "parent.id") Child map(ChildDto dto, Parent parent); Now I need …

java mapping mapstruct
MapStruct ignore automatically unmapped properties

I am using MapStruct with big models (more than 50 fields) shared between different business use cases in my code. Depending …

java mapstruct
How to write Junit test for mapstruct abstract mapper injected via Spring

I'm using MapStruct, mapstruct-jdk8 version 1.1.0.Final and defining abstract class that I inject via Spring. I'm looking at how to …

spring unit-testing junit spring-test mapstruct