小知识点BeanUtils.copyProperties

简介: 通过BeanUtils.copyProperties可以时间拷贝对象中的值,下面的new String[]{"cid","agreeFlag","flag","publishTime","projectNum"}表示的不拷贝的属性值CopyRight copyRight = copyRightService.createCopyRight(request, user);//获得要修改


通过BeanUtils.copyProperties可以时间拷贝对象中的值,下面的new String[]{"cid","agreeFlag","flag","publishTime","projectNum"}表示的不拷贝的属性值


CopyRight copyRight = copyRightService.createCopyRight(request, user);
//获得要修改的course,然后重新设置参数
CopyRight copyRightInDataBase = copyRightService.findByCopyRightId(copyRight.getCid());
BeanUtils.copyProperties(copyRight, copyRightInDataBase,
      new String[]{"cid","agreeFlag","flag","publishTime","projectNum"})


目录
相关文章
|
Java Spring
解决Spring工具类BeanUtils copyProperties方法复制null的问题
解决Spring工具类BeanUtils copyProperties方法复制null的问题
864 0
|
4月前
|
Java Apache
BeanUtils.copyProperties()用法总结
BeanUtils.copyProperties()用法总结
|
4月前
|
前端开发 Java 数据处理
BeanUtils.copyProperties的用法
BeanUtils.copyProperties的用法
|
3月前
|
Java Apache 开发者
介绍BeanUtils.copyProperties方法
介绍BeanUtils.copyProperties方法
|
4月前
|
Java API
beanutils.copyproperties
beanutils.copyproperties
|
Java Apache 数据库
Spring的BeanUtils的copyProperties方法
项目中遇到的情况是: 文件解析完之后将文件放在一个pojo里面
120 0
|
Java API
BeanUtils.copyProperties(A,B)字段复制
BeanUtils.copyProperties(A,B)字段复制
80 0
|
Java 测试技术 Spring
为什么不推荐使用 BeanUtils ?
为什么不推荐使用 BeanUtils ?
313 0
为什么不推荐使用 BeanUtils ?