-
-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MapStruct 1.3.0.Final produces uncompilable code when using Java 11 + Lombok 1.18.6 #1742
Comments
2 questions..Have you looked at: #1713 ? you can disable builders, which most likely solves your problem.. Why are you combining setter/getter with builder? |
JPA requires getters/setters. The Builder annotation is convenient for testing (mock data). If I remove the Builder annotation from the SecondEntityDTO class - will this solve the problem? |
Most likely yes.. The Builder implies to us (at this point in time) immutable. Hence, we try to analyse it that way. |
@DmitriiSolovev .. That this solve your problem? |
@sjaakd I need both getters/setters (jpa) and a builder (mock data, unit testing etc, ). As a workaround, I use MapStruct 1.2.0.Final now. However, it seems to me that this will help me - https://projectlombok.org/features/experimental/Accessors @Accessors(chain = true) Then I can remove Builder annotation. I will write you the results later. |
Same problem here with nested objects
Generate
|
I have the same problem when source and target is of same class. I am going with work around MapStruct 1.2.0.Final for now. Thanks! @DmitriiSolovev |
…type always available
…type always available
…type always available
Applying changes done in 3371058
Applying changes done in 3371058
Applying changes done in 3371058
Applying changes done in 3371058
Thanks for your comments. At the moment I don't have much time to build a demo from my project, but I put my POM file with what I built my project and my DTOs, I hope this helps.
package net.ronasoft.rsftapi.dto; } import java.sql.Timestamp; import net.ronasoft.rsftapi.commons.CONSTANTS; } public class ListDetailDTO { } package net.ronasoft.rsftapi.dto; } } import java.util.List; public class UserListDTO { } import org.mapstruct.Mapper; import net.ronasoft.rsftapi.entities.ListDetail; @Mapper(uses=DateMapper.class, componentModel = "cdi") } The truth is not if it is a new problem but I would think it is the same problem, this is also written in https://stackoverflow.com/ in the question: Is Mapstruct Java11 compatible ?. He carried out the same operations and they mention and I have not had a positive result. |
@lo-rodriguez I would ask you again to not comment on old issues. Please open a new issue explaining what problem you have and how we can reproduce it. |
My setup: Java 11.02, Gradle 5.2.1, MapStruct 1.3.0.Final, Lombok 1.18.6 and Spring Boot 2.3.1.
build.gradle
FirstEntity.java
FirstEntityDTO.java
SecondEntity.java
SecondEntityDTO.java
EntityMapper.java
Generated code, MapStruct 1.3.0.Final
Generated code, MapStruct 1.2.0.Final
As a workaround, I use MapStruct 1.2.0.Final now.
The text was updated successfully, but these errors were encountered: