【发布时间】:2021-12-16 12:43:57
【问题描述】:
我有以下情况:
**public class SimpleSource {
private String name;
private String description;
// getters and setters
}
public class SimpleDestination {
private String name__c;
private String description__c;
// getters and setters
ContactMapper contactMapper = Mappers.getMapper(ContactMapper.class);
@Mapping(source = "name", target = "name__c")
@Mapping(source = "description", target = "description__c")
Target__c customerContact(Source source);**
我怎样才能避免为所有字段添加这个@Mapping,只是说目标有 suffix "__c" targetFieldName = sourceFieldName+suffix
【问题讨论】: