@Transactional
@Override
public Type updateType(Long id, Type type) {
Type t=typeRepository.findOne(id);
if(t ==null ){
throw new NotFoundException("资源找不到");
}
BeanUtils.copyProperties(type,t);
return typeRepository.save(t);
}
spring boot的service层的update的实现
最新推荐文章于 2022-02-17 21:14:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)