github mapstruct/mapstruct 1.2.0.CR2

latest releases: 1.6.0.Beta1, 1.5.5.Final, 1.5.4.Final...
pre-release6 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)

Don't miss a new mapstruct release

NewReleases is sending notifications on new releases.