MapStruct v1.2.0.CR2 Release Notes
Release Date: 2017-08-28 // over 6 years ago-
โจ Enhancements
- ๐ Extension of
mappingInheritanceStrategy
, removing of name based ignore reverse mapping (#1255) - See important notice
๐ Bug fixes
- โก๏ธ Use update methods for different sources for nested targets (#1269)
๐ Documentation
- ๐ Fixing typos in the documentation
- โ Add note that
@MappingTarget
must not benull
(#748)
Tooling
Important notice:
- With the fix for #1065 in
1.2.0.Beta2
, where we added inheritance of Reverse Mappings as well, the issue #1255 occurred. Therefore theMappingInheritanceStrategy
has been extend:EXPLICIT
- Only inherits if explicitly statedAUTO_INHERIT_FROM_CONFIG
- Will automatically inherit only forward configurationAUTO_INHERIT_REVERSE_FROM_CONFIG
- Will automatically inherit only reverse configurationAUTO_INHERIT_ALL_FROM_CONFIG
- Will automatically inherit both forward and reverse configuration
โ Additionally mappings that only have target name and ignore are inherited only in forward mappings, no matter of the inheritance strategy.
A mapping like:
@Mapping(target = "field1", ignore = true)TargetBase map(SourceBase source)
Will only inherit forward mappings. There won't be any name based matching for ignoring in the reverse. If you want to ignore a field with the same name in
SourceBase
you will need to define a mapping like:@Mapping(target = "field1", source = "field1`, ignore = true)`TargetBase map(SourceBase source)
- ๐ Extension of