带有本地查询的spring数据jpa

时间:2018-11-13 06:33:06

标签: spring spring-data-jpa

我正在尝试Spring Data JPA。我的存储库方法是这样的:

@Query(value = "SELECT * FROM test_result WHERE FK_TEST_PAPER_ID=?1 AND PERCENTAGE_OBTAINED BETWEEN :?2 AND :?3 ?#{#pageable}", nativeQuery = true)
Page<TestResult> findResult(long testPaperId, Float minpercentage, Float maxpercentage, Pageable pageInfo);

我的服务实现代码如下:

Page<TestResult> getAllResult1 = testResultRepository.findResult(testPaperId,minpercentage,maxpercentage,pageInfo);

我收到此错误:Paging query needs to have a Pageable parameter! 我是春天的新手。请帮忙。

1 个答案:

答案 0 :(得分:0)

从查询中删除?#{#pageable}