博主首页

jpa实体对象调用set方法会自动修改数据库

一旦将属性set  ,jpa会自动修改

 

import org.springframework.beans.BeanUtils;
        JobPO jobPOre = jobService.getByJobId(jobId).orElse(null);
        if(jobPOre==null){return RestResult.success();}
        JobPO jobPO = new JobPO();
        BeanUtils.copyProperties(jobPOre,jobPO);

 

posted @ 2022-03-23 10:39  笑~笑  阅读(310)  评论(0)    收藏  举报