在项目中同步信息时,有两个实体类,属性名相同,需要进行转换,使用
BeanUtils.copyProperties()//import org.springframework.beans.BeanUtils;
例如,将platformMerchant转换为markeMerchant
MarkeMerchant markeMerchant = new MarkeMerchant();
BeanUtils.copyProperties(platformMerchant,markeMerchant);
if (markeMerchant != null){
markeMerchantService.save(markeMerchant);
}
Q.E.D.