使用org.springframework.beans.BeanUtils.copyProperties方法进行对象之间属性的赋值,避免通过get、set方法一个一个属性的赋值
源码:
/**
* 对象属性拷贝 <br>
* 将源对象的属性拷贝到目标对象
*
* @param source 源对象
* @param target 目标对象
*/
public static void copyProperties(Object source, Object target) throws BeansException {
copyProperties(source, target, (Class)null, (String[])null);
}