问题 I need to inject a spring service class in the generated mapper implementation, so that I can use it via @Mapping(target="x", expression="java(myservice.findById(id))")" Is this applicable in Mapstruct-1.0? 回答1: It should be possible if you declare Spring as the component model and add a reference to the type of myservice : @Mapper(componentModel="spring", uses=MyService.class) public interface MyMapper { ... } That mechanism is meant for providing access to other mapping methods to be called