Mapstruct throws me the next error on compilation stage:
ConfigsMapperImpl is not abstract and does not override abstract method toConfigs(ConfigsDTO)
At the same moment MapStruct generate code for all other methods well.
I suppose that happens because Config
object has more fields than ConfigsDTO
.
@Mapper
public interface ConfigsMapper {
ConfigsMapper INSTANCE = Mappers.getMapper(ConfigsMapper.class);
ConfigsDTO ConfigsToConfigsDTO(Configs configs);
List<ConfigsDTO> toConfigsDTOs(List<Configs> configs);
@InheritInverseConfiguration
Configs toConfigs(ConfigsDTO configsDTO);
}
In the generated method implementations all readable properties from the source type (e.g. Configs) will be copied into the corresponding property in the target type (e.g. ConfigsDTO). If a property has a different name in the target entity, its name can be specified via the @Mapping annotation.
The annotation @Mappings define which attributes from source will be transferred to specific attribute in target. The annotation define that @InheritInverseConfiguration inverse mapping to be done.
For example: