The summer is nearly there, and so is MapStruct 1.2.
Today it’s my pleasure to announce another release on our way to the Final: MapStruct 1.2 Beta 3!
This release continues to improve and stabilize the new feature of automatically creating sub-mapping methods.
By default, no sub-mapping methods are generated for any types of the JDK (as those are typically no bean types which one would like to step into in the course of mapping).
If more fine-grained control is needed, there is an SPI now which lets you define for which types sub-mapping methods should be created.
Eventually, you also can turn off automatic sub-mappings completely if you prefer to have full control by explicitly defining all required bean mapping methods.
Besides that, several bugs were fixed:
- The generated mappers were missing import statements in some cases (#1215, #1164)
- Field mappings didn’t work for nested target properties (#1155)
- Accessing a non-existent nested target property wasn’t handled gracefully (#1153)
Just shy of a month after the first Beta release of MapStruct 1.2, the team is happy to announce the second Beta, fixing a couple of bugs that sneaked in with the many new features offered by the new 1.2 release line.
We fixed 16 issues, most of them reported by users. The most infamous bugs reported and fixed are:
Plus, the newly introduced automapping feature now also creates Enum mapping methods.
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)
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.
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