标签:springdata jpa update delete @modifying @query
使用@Modifying + @Query 实现springData 对数据的 update delete
public interface ICustomer extends JpaRepository<Customer, Long> { @Modifying @Query("delete Customer where isLogicDel = 0 and dispatchDate = ?1 ") public int deleteCustomer(Date dispatchDate); @Modifying @Query("update Customer d set d.isLogicDel = 1 where d.member.id = ?1 and d.dispatchDate = ?2 ") public int updateCustomer(Long memberId, Date dispatchDate); }
标签:springdata jpa update delete @modifying @query
原文地址:http://amadis.blog.51cto.com/2723533/1441301