【发布时间】:2019-05-25 21:25:03
【问题描述】:
我正在使用 MapStruct 1.3.0.Final 将 Dto 转换为 POJO,反之亦然,将 spring 值转换为 mapstruct.defaultComponentModel 选项。为了避免由于双向关系导致的 stackoverflow 错误,我点击了下一个链接:
其中一些转换器已按照以下说明进行了修饰:
Customizing Mappers Using Decorators
问题是:
如何使用uses选项在其他转换器中使用修饰转换器?
按照第二个链接中包含的示例,我进行了测试:
@Mapper(componentModel="spring", uses={PersonMapper.class})
public interface OtherMapper
@Mapper(componentModel="spring", uses={PersonMapperDecorator.class})
public interface OtherMapper
但我还没有实现OtherMapper 使用PersonMapperDecorator。
【问题讨论】: