Closed kevinmails closed 1 year ago
My code like this: public interface CarMapper extends Converter<Car, CarDTO> { @Override @Mappings( @Mapping(source = "wheels",target = "carWheels") ) CarDTO convert(Car source); }
public interface CarMapper extends Converter<Car, CarDTO> { @Override @Mappings( @Mapping(source = "wheels",target = "carWheels") ) CarDTO convert(Car source); }
how can i get a Inversed method "Car convert(CarDTO source);"
There's no built-in way to achieve this. Spring Converters work in only one direction. If you require a two-way mapping, you'll have to define a second Converter skeleton.
My code like this:
public interface CarMapper extends Converter<Car, CarDTO> { @Override @Mappings( @Mapping(source = "wheels",target = "carWheels") ) CarDTO convert(Car source); }
how can i get a Inversed method "Car convert(CarDTO source);"