小知识点BeanUtils.copyProperties



通过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"})

上一篇:mysql通配符使用


下一篇:MySQL、MongoDB、Redis数据库Docker镜像制作