【发布时间】:2019-09-08 18:59:36
【问题描述】:
我正在尝试在我的界面中进行自定义插入查询,以扩展 JpaRepository
public interface CustomerCouponDAO extends JpaRepository<CustomerCoupons, Integer>{
@Query("INSERT into customer_coupons (customerId, couponId) values (?,?)")
public void insert(Integer custid, Integer coup);
}
但是当我得到异常时:
原因:java.lang.IllegalArgumentException:JDBC 样式参数 (?) JPA 查询不支持。
关于如何进行插入查询的任何想法?
【问题讨论】:
标签: spring jpa spring-data-jpa spring-data