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 be null (#748)

    Tooling

    • โž• Add japicmp for the MapStruct API (#1231)
    • ๐Ÿš€ Deploy SNAPSHOTs from Travis (#1251)

    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 the MappingInheritanceStrategy has been extend:
      • EXPLICIT - Only inherits if explicitly stated
      • AUTO_INHERIT_FROM_CONFIG - Will automatically inherit only forward configuration
      • AUTO_INHERIT_REVERSE_FROM_CONFIG - Will automatically inherit only reverse configuration
      • AUTO_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)