Skip to content
Advertisement

MapStruct ignore all unmapped properties for specific method

There are several ways to ignore unmapped target properties in mapstruct.

  1. We could list all properties to ignore for specific method:
JavaScript
  1. Or specify to ignore all properties on mapper level :
JavaScript

Is there a way to mix these approaches and ignore all properties at the method level without explisently list all of them?

Advertisement

Answer

Using the BeanMapping annotation you can specify this at method level.

JavaScript

The javadoc can be found here.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement