mapstruct Questions

2

Solved

I want the generated mapstruct mapping method to return null if all the properties referenced in @Mapping/source are null. For exemple, I have the following mapping : @Mappings({ @Mapping(target...
Approximal asked 13/4, 2017 at 12:11

6

Solved

I'm trying to use Intellij 2017 Ultimate to build/run a Spring Boot application that uses MapStruct. It is a Gradle project. My issue is that IntelliJ does not seem to run the MapStruct Annotation ...
Mohair asked 28/3, 2018 at 17:42

1

I can't seem to use mapstruct correctly @Mapping(target = "products", source = "itemBookType") SearchBookingResult backToTp(ItemBook itemBook); When running this code I get the...
Bigmouth asked 9/8, 2022 at 6:53

2

I am using MapStruct to map values from a source to a target class. The source class has a String property and the target class has a java.util.Date property. The source property is like this: "yyy...
Lois asked 24/3, 2020 at 17:20

1

I have a kotlin data class with default values and when I try to map it using MapStruct it throws an error at runtime because it will try to assign a null value to a non-nullable type for a propert...
Willin asked 15/3, 2022 at 15:28

10

Solved

I am a newbie to Spring Boot and MapStruct Tool. Earlier, A Project(written by other team using these technologies) is not starting up. Then, I had made some changes in Mapper Abstract Class but ...
Chally asked 9/6, 2017 at 12:39

3

Solved

I am having below mapper class in which I want to use CounterService. I am trying constructor injection but that's not working and null is printing. @Mapper(componentModel = "spring", uses = Count...
Pilaf asked 18/10, 2019 at 13:10

2

Solved

I am using MapStruct to map from a JPA entity to a POJO DTO, in a Spring app with dependency injection. I have added some additional processing of the DTO to a method in a decorator as specified i...
Hotblooded asked 16/5, 2016 at 11:4

1

I'm trying to map from Protobuf to POJO. Here's the POJO: public class CreateNodesAllDataDto { private List<UpsertNodeDto> tables; private List<UpsertColumnDto> columns; } where ups...
Psychobiology asked 10/4, 2021 at 7:52

2

Solved

What is the best way to perform MapStruct mapping from a Data Transfer Object (DTO) to a Hibernate entity with a bi-directional one-to-many association? Assume we have a BookDto with multiple revie...
Weise asked 23/4, 2022 at 21:10

3

Here is the error during maven compile error compiling: java.lang.NoClassDefFoundError: javax/persistence/Entity: javax.persistence.Entity I deleted all entity classes and compile was ok. Is it a b...
Diaeresis asked 6/9, 2021 at 9:48

2

Solved

I would like to mapping a model object to dto model. I already have mapper for one of the object. How can I reuse this mapper in another mapper which is in another class? I have below as model @Ge...
Almazan asked 4/3, 2020 at 9:51

1

@Mapper(componentModel = "spring") public interface DemoConvert { public static DemoConvert INSTANCE = mappers.getMapper(DemoConvert.class); @AutoWired private PersonInfoSearchService...
Midday asked 4/2, 2022 at 7:4

2

Solved

I want to map the following classes class Schedule { ZoneId timezoneId; List<AvailabilityRule> rules; } class AvailabilityRule { long startEpoch; long endEpoch; } to these classes. clas...
Cootch asked 20/1, 2022 at 9:41

4

Solved

I am trying to use mapstruct in my Play 2.4 Java8 JPA project. Steps I have done: Added Dependency "org.mapstruct" % "mapstruct-jdk8" % "1.1.0.Beta1", "org.mapstruct" % "mapstruct-processor" % ...
Felloe asked 2/7, 2016 at 17:49

3

Solved

I want to enable AspectJ compiler in my IntelliJ Idea as I have several aspects that I'd like to be woven during compile time. At the same time, I am using Lombok and Mapstruct in my codebase. T...
Thunell asked 9/10, 2019 at 19:28

2

Solved

I have been going through the documentation of MapStruct and can't seem to figure out when the annotation @BeanMapping should be used. The documentation seems to extensively use just @Mapping for m...
Isagogics asked 29/3, 2019 at 12:7

3

Solved

I'm following the guide at the MapStruct blog and having trouble using this 3 technology together. I've been trying several approaches from the MapStruct docs, bug-reports, posts from here but in e...
Swore asked 27/8, 2020 at 16:30

2

Solved

I have a mapper that, for a particular attribute of the target class, needs to choose one from a list of objects inside the source object, and map it using a differente mapper class. Simplifying it...
Beaufort asked 17/11, 2021 at 13:35

2

Solved

I have the following mapper @Mapper(config = MappingConfig.class) public interface PokerRoomMapper { @Mapping(target = "phase", nullValuePropertyMappingStrategy = NullValuePropertyMappi...
Mashe asked 1/3, 2021 at 15:56

8

Solved

I'm developing a web app created with JHipster v2.20.0. Using Eclipse 4.5.0 WTP as IDE. The Spring configuration is annotation based. I've just merged this pull with our code. When I try to run ...
Produce asked 16/9, 2015 at 13:17

3

Solved

How could I use a HashMap<String, Object> as source to an object? Here is my target object: public class ComponentStyleDTO{ private String attribute; private Object value; } I've tried ...
Cyclist asked 8/2, 2019 at 22:13

2

I currently have a Map<String, String> that contains values in the form key = value and I would like to "expand" those into a real object. Is it possible to automate that with MapStruct and ...
Perpetrate asked 14/2, 2017 at 12:59

4

Solved

I have come across a situation where my mapping method has 3 parameters, and all the three are being used in deriving one of the properties of the target type. I have created a default mapping met...
Lang asked 7/12, 2017 at 11:50

2

Solved

Upon mvn clean install smart execution in IntelliJ Idea using Java 11 I get the following warning: Warning:java: Supported source version 'RELEASE_6' from annotation processor 'net.java.dev.hickor...
Antipyrine asked 16/7, 2020 at 10:15

© 2022 - 2024 — McMap. All rights reserved.