springdataJPA注解提交更新数据
时间:2020-06-23 19:34:28
收藏:0
阅读:52
@Transactional
@Modifying(clearAutomatically = true)
@Query(value ="update user set gender=:gender,phone=:phone,email=:email,updatetime=:updatetime,remarks=:remarks where u_id=:u_id", nativeQuery=true)
int update(String name, BigDecimal height, BigDecimal weight, int id);
参考:
@Transactional 作用:用于提交事务
@Modifying(clearAutomatically = true) 作用:自动清除实体里保存的数据