【发布时间】:2017-10-03 14:54:15
【问题描述】:
我正在使用 Spring 框架,在以下存储库 currentOrder 方法中,我将日期作为参数发送,但是当我这样做时,Parameter with that position [1] did not exist 抛出异常
我正在发送以下网址
http://localhost:3000/api/orders/search/currentOrder?fromDate=2017-04-28&toDate=2017-05-02
我的代码哪里出错了?
public interface OrderRepository extends JpaRepository<Order, Long> {
@PreAuthorize("hasAuthority('rights')")
@Query("Select o.orderDate from Order o where o.orderDate between fromDate and toDate")
List<Order> currentOrder(@Param("fromDate") Date fromDate,@Param("toDate") Date toDate);
}
【问题讨论】:
标签: java spring date jpa exception