我也只想回答这个问题:
您可以创建自己的实现FieldMapper
并将其自动连接到您的lineMapper.setFieldSetMapper()
@Component
class CustomFieldSetMapper implements FieldSetMapper<Partnership>{
@Override
public Partnership mapFieldSet(FieldSet fieldSet) throws BindException {
return new Partnership(
partnerCrmId:fieldSet.readString('partnerCrmId'),
partnerType: fieldSet.readString('partnerType'),
customerCrmId: fieldSet.readString('customerCrmId'),
startDate: fieldSet.readString('startDate'),
endDate: fieldSet.readString('endDate'),
clientId: fieldSet.readRawString('clientId'),
status: fieldSet.readString('status'),
type: fieldSet.readString('type'),
providerCode: fieldSet.readString('providerCode'),
lastModifiedDate: fieldSet.readString('lastModifiedDate')
)
}
}