BeanUtils是一个java中的工具类,用来做po和vo之间的相互转换工作,但是有两个不同的BeanUtils:
1、org.apache.commons.beanutils.BeanUtils
BeanUtils.copyProperties(teacher, student);是指将student中的值赋给teacher
2、org.springframework.beans.BeanUtils
BeanUtils.copyProperties(teacher, student);是指将teacher中的值赋给student
这两个包中的BeanUtils的copyProperties方法使用刚好相反,记录一下,以免出错。
1、org.apache.commons.beanutils.BeanUtils
BeanUtils.copyProperties(teacher, student);是指将student中的值赋给teacher
2、org.springframework.beans.BeanUtils
BeanUtils.copyProperties(teacher, student);是指将teacher中的值赋给student
这两个包中的BeanUtils的copyProperties方法使用刚好相反,记录一下,以免出错。