在接口方法中使用以下代码
@Modifying
@Transactional
@Query(value ="delete from product where product_id = ?1", nativeQuery = true)
void deleteType(Integer product_id);
注意:里面的 ?1 代表的是方法中传过来的第一个参数product_id;
如果有多个参数则可以写成: procudt_id1 = ?1, product_id2 = ?2
void deleteType(Integer product_id1, Integer product_id2)