BeanUtil.copyproperties() 源中值会覆盖target中的值
//1.spring中的使用,不需要引入依赖
BeanUtil.copyproperties(source,target);
//2.apach
2.1依赖
<!-- apache中BeanUtils的依赖 org.apache.commons.beanutils.BeanUtils.copyProperties -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<!-- 创建springboot项目 org.springframework.beans.BeanUtils -->
2.2BeanUtil.copyproperties(target,source);
注意:拷贝属性值成功的前提,属性命类型都相同