将数据从一个对象复制到另一个对象使用Spring的BeanUtils
import org.springframework.beans.BeanUtils类,
只需要一行代码即可将orderDTO对象的属性值赋值给order对象中对应的属性:
BeanUtils.copyProperties(orderDTO, order);
import org.springframework.beans.BeanUtils类,
只需要一行代码即可将orderDTO对象的属性值赋值给order对象中对应的属性:
BeanUtils.copyProperties(orderDTO, order);