Support for Lombok, direct field access and much more: MapStruct 1.2.0.Beta1 is out

It’ my pleasure to announce the first Beta release of MapStruct 1.2.

The new release comes with a whole lot of new functionality, e.g.:

  • MapStruct can now be used together with Project Lombok
  • Support for Java 8 streams
  • Mappings based on public fields (i.e. you can write DTOs without getters and setters)
  • Automatic creation of sub-mapping methods
  • Mapping methods can take “pass-through” context parameters, addressing different use cases like
    • Passing a locale, timezone or similar to custom mapping methods
    • Keeping track of processed nodes in circular object graphs
  • Target bean factory methods can access a mapping’s source parameter(s)

Read more...

New Year, new Website!

The MapStruct team wishes a Happy New Year to all our users out there!

To start the new year fresh, we’ve given some love to our website. While its looks only slightly changed, its inner workings have been overhauled from ground up. It’s driven by Hugo now, a static website generator written in Go which is very popular these days.

Read more...

MapStruct 1.1.0.Final seen in the wild!

I’m more than thrilled to report that MapStruct 1.1 Final has been spotted in the wild! We grew that puppy for almost one year since the announcement of MapStruct 1.0, so it was about time to let it go and put a final release into your hands.

Besides a plethora of bug fixes the 1.1 release adds many new features which should be very welcome to users of MapStruct 1.0:

  • Nested target properties
  • @ValueMapping annotation for enum mappings
  • @Named annotation for simple string based mapping qualifiers
  • Support for custom hasXyz() methods to check the presence of source properties instead of null checks
  • Extended support of java.text.NumberFormat for Number types to String mapping
  • OSGi support
  • New built-in conversions around date/time type

Read more...

MapStruct 1.1.0.CR2 is out

It’s my pleasure to announce the second candidate release of MapStruct 1.1!

This release fixes several bugs discovered in the first CR but also adds some new built-in conversions around date/time types (e.g. from/to the java.sql.* types and between java.time.LocalDate and java.util.Date). Normally, we wouldn’t add new functionality during the CR phase, but as these conversions have been contributed by community members (kudos to you!), we thought it’d be nice to put them into a release as soon as possible.

Read more...

MapStruct 1.1.0.CR1 released

MapStruct 1.1.0.CR1 consolodates the functionality introduced in the preceeding MapStruct 1.1.0 Beta releases. A number of bugs were solved:

  • Automatic generation of an iterable mapping methods where the property selection is based on a qualfier.
  • Collection source getter null check to avoid NullPointExceptions.
  • Missing imports for generic types in collections in generated methods.
  • Removing redundant code from generated code when using nested source properties.
  • Optimisation when using enum constant (using an enum constant instead of a String conversion).
  • Fixing order for dependsOn.
  • Fixing an issue introduced 1.1.0.Beta2 that causes problems for the @MappingTarget in combination with @InheritInverseConfiguration

Read more...