I am updating a bean according to documentation:
@Mapper
public interface CarMapper {
void updateCarFromDto(CarDto carDto, @MappingTarget Car car);
}
Is it possible to tell mapstruct to ignore a certain field(s) ? F.e. I don't want mapstruct to map id field from carDto to car entity, and that is what mapstruct will do if I don't define the body and skip id field mapping manually.
If it's not currently possible, is there any workaround (different than own impl.) ?
Use @Mapping( target = "id", ignore = true ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With