Comments (5)
When removing the @SuperBuilder
from the target object, then the warnings are shown for me.
Can you tell me if this is the case in your code? If yes, then it is due to #159
from mapstruct-idea.
Perfect, will be fixed soon in #159. 👍
from mapstruct-idea.
Hi @aleksvidak
Thank you for the report. I cannot reproduce this. The following sample generates warnings for me (does not matter if mapped from a record or a class):
import org.mapstruct.Mapper;
@Mapper
interface UserRecordMapper {
UserDto mapFromRecord(UserRecord user);
UserDto mapFromClass(UserClass user);
}
record UserRecord(String username, String password) { }
record UserDto(String name, String pw) { }
class UserClass {
public String username;
public String password;
}
Would you be so kind and post your code of User
and UserDto
?
from mapstruct-idea.
The case is when mapping from record to class.
public record UserDto(String test, String test4) implements Serializable {}
@SuperBuilder(toBuilder = true)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class User {
private String test;
private String test2;
private String test3;
}
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface UserMapper {
User toEntity(UserDto userDto);
UserDto toDto(User user);
}
from mapstruct-idea.
When removing the
@SuperBuilder
from the target object, then the warnings are shown for me. Can you tell me if this is the case in your code? If yes, then it is due to #159
Yes, when I remove @SuperBuilder
, warnings are back.
from mapstruct-idea.
Related Issues (20)
- Use `unmappedTargetPolicy` in the unmapped target properties inspection
- Support for completion and Go To Definition within Mapping#qualifiedByName - for shared configurations HOT 5
- when I enable the plugin, the target class is different from the one when I disable the plugin HOT 1
- java.lang.ClassCastException: Object of type Address can't be cast to CompositeTracker HOT 1
- Support the '-Amapstruct.unmappedTargetPolicy' config of maven-compiler-plugin HOT 1
- Rework `@InheritConfiguration` and support auto-inheritance
- Fix build with ideaVersion `LATEST-EAP-SNAPSHOT` HOT 3
- Fix workaround for getting the mockJDK annotations.jar in the gradle build HOT 1
- Code completion doesn't work with lombok @SuperBuilder annotation HOT 3
- Auto completion for InheritConfiguration#name, InheritInverseConfiguration#name HOT 1
- Disable unmapped target property warnings when implicitly mapping from a map HOT 2
- Completion for properties don't work (both target and source) HOT 2
- Array and Map paramter ignored as source-parameter if used as only source
- Java expression HOT 1
- Report Non-existing target properties as errors HOT 1
- WrongUsageOfMappersFactoryInspection ignores if componentModel is defined in MapperConfig HOT 1
- IDE Support of `BeanMapping#ignoredTargets`
- Code Completion didn't work well. HOT 12
- Wrong usage of mappers factory should be able to remove static initializer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapstruct-idea.