天天看点

小知识点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"})