There are several ways to ignore unmapped target properties in mapstruct.
@Mapping(target = "propName", ignore = true)
@Mapper(
unmappedTargetPolicy = ReportingPolicy.IGNORE
)
Is there a way to mix these approaches and ignore all properties at the method level without explisently list all of them?
Using the BeanMapping
annotation you can specify this at method level.
@BeanMapping(unmappedTargetPolicy = ReportingPolicy.IGNORE)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.