I have Car:
- id
- brand
- model
- owner
And CarDTO:
- id
- brand
- model
In my service class I'm passing additional parameter "owner" and I need to convert the list.
Is it possible to add "owner" to Mapper?
If yes then I suppose it should be something similar to this (not working).
@Mapper
public interface CarMapper {
@Mapping(target = "owner", source = "owner")
List<Car> mapCars(List<CarDTO> cars, String owner);
}
@Mapping(target = "owner", expression = "java(owner)")
. – Quintic