JPA中使用@Query对数据库进行删除和更新操作,sql语句动态接收参数
在接口方法中使用以下代码 @Modifying @Transactional @Query(value ="delete from product where product_id = ?1", nativeQuery = true) void deleteType(Integer product_id);注意:里面的 ?1 代表的是方法中传过来的第一个参数produ...
原创
2019-09-03 13:59:05 ·
3019 阅读 ·
0 评论