mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Add sample of @Mapping annotation to @InheritInverseConfiguration
This commit is contained in:
parent
fc5f937a71
commit
b03ca8b7a9
@ -2235,7 +2235,7 @@ In case of bi-directional mappings, e.g. from entity to DTO and from DTO to enti
|
|||||||
|
|
||||||
Use the annotation `@InheritInverseConfiguration` to indicate that a method shall inherit the inverse configuration of the corresponding reverse method.
|
Use the annotation `@InheritInverseConfiguration` to indicate that a method shall inherit the inverse configuration of the corresponding reverse method.
|
||||||
|
|
||||||
.Inverse mapping method inheriting its configuration
|
.Inverse mapping method inheriting its configuration and ignoring some of them
|
||||||
====
|
====
|
||||||
[source, java, linenums]
|
[source, java, linenums]
|
||||||
[subs="verbatim,attributes"]
|
[subs="verbatim,attributes"]
|
||||||
@ -2247,6 +2247,7 @@ public interface CarMapper {
|
|||||||
CarDto carToDto(Car car);
|
CarDto carToDto(Car car);
|
||||||
|
|
||||||
@InheritInverseConfiguration
|
@InheritInverseConfiguration
|
||||||
|
@Mapping(target = "numberOfSeats", ignore = true)
|
||||||
Car carDtoToCar(CarDto carDto);
|
Car carDtoToCar(CarDto carDto);
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
Loading…
x
Reference in New Issue
Block a user