diff --git a/NEXT_RELEASE_CHANGELOG.md b/NEXT_RELEASE_CHANGELOG.md index f08c6a2fd..e0f4cd31f 100644 --- a/NEXT_RELEASE_CHANGELOG.md +++ b/NEXT_RELEASE_CHANGELOG.md @@ -1,89 +1,10 @@ -### Enhancements +### Features -* Breaking change: (#3574) - -This reverts #2560, because we've decided that `@BeanMapping(ignoreByDefault = true)` should only be applied to target properties and not to source properties. -Source properties are ignored anyway, the `BeanMapping#unmappedSourcePolicy` should be used to control what should happen with unmapped source policy +### Enhancements ### Bugs -* Breaking change: Presence check method used only once when multiple source parameters are provided (#3601) -* Fix `@SubclassMapping` not working with `@BeanMapping#ignoreUnmappedSourceProperties` (#3609) -* Fix duplicate method generation with recursive auto mapping (#3591) - ### Documentation -* Fix documentation of `unmappedSourcePolicy` default value (#3635) -* Fix documentation link of before and after mapping when using builders (#3639) -* Fix typo in experimental note (#3634) -* Add example classes for the passing target type documentation (#3504) - ### Build -* Enforce whitespaces around the for colon with CheckStyle (#3642) - -## Breaking changes - -### Presence checks for source parameters - -In 1.6, support for presence checks on source parameters has been added. -This means that even if you want to map a source parameter directly to some target property the new `@SourceParameterCondition` or `@Condition(appliesTo = ConditionStrategy.SOURCE_PARAMETERS)` should be used. - -e.g. - -If we had the following in 1.5: -```java -@Mapper -public interface OrderMapper { - - @Mapping(source = "dto", target = "customer", conditionQualifiedByName = "mapCustomerFromOrder") - Order map(OrderDTO dto); - - @Condition - @Named("mapCustomerFromOrder") - default boolean mapCustomerFromOrder(OrderDTO dto) { - return dto != null && dto.getCustomerName() != null; - } - -} -``` - -Then MapStruct would generate - -```java -public class OrderMapperImpl implements OrderMapper { - - @Override - public Order map(OrderDTO dto) { - if ( dto == null ) { - return null; - } - - Order order = new Order(); - - if ( mapCustomerFromOrder( dto ) ) { - order.setCustomer( orderDtoToCustomer( orderDTO ) ); - } - - return order; - } -} -``` - -In order for the same to be generated in 1.6, the mapper needs to look like this: - -```java -@Mapper -public interface OrderMapper { - - @Mapping(source = "dto", target = "customer", conditionQualifiedByName = "mapCustomerFromOrder") - Order map(OrderDTO dto); - - @SourceParameterCondition - @Named("mapCustomerFromOrder") - default boolean mapCustomerFromOrder(OrderDTO dto) { - return dto != null && dto.getCustomerName() != null; - } - -} -``` - diff --git a/build-config/pom.xml b/build-config/pom.xml index ff56bd795..0bdec734c 100644 --- a/build-config/pom.xml +++ b/build-config/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/core-jdk8/pom.xml b/core-jdk8/pom.xml index d2806fa41..160f963ad 100644 --- a/core-jdk8/pom.xml +++ b/core-jdk8/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/core/pom.xml b/core/pom.xml index 478ef7308..ac993c73d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/distribution/pom.xml b/distribution/pom.xml index 4bd4bc5dc..afa8e3100 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/documentation/pom.xml b/documentation/pom.xml index d98933a41..0a62a3ef3 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/integrationtest/pom.xml b/integrationtest/pom.xml index 10850bc82..f888e226f 100644 --- a/integrationtest/pom.xml +++ b/integrationtest/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml diff --git a/parent/pom.xml b/parent/pom.xml index 2b3b8e65a..e4109325f 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -11,7 +11,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT pom MapStruct Parent @@ -28,7 +28,7 @@ ${java.version} ${java.version} - 2024-07-20T15:36:10Z + ${git.commit.author.time} 1.0.0.Alpha3 3.4.1 diff --git a/pom.xml b/pom.xml index 571623372..90402f0ca 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT parent/pom.xml diff --git a/processor/pom.xml b/processor/pom.xml index e33e84ba6..12fc615f5 100644 --- a/processor/pom.xml +++ b/processor/pom.xml @@ -12,7 +12,7 @@ org.mapstruct mapstruct-parent - 1.6.0.RC1 + 1.6.0-SNAPSHOT ../parent/pom.xml