【问题标题】:spring data jpa with native query带有本机查询的spring data jpa
【发布时间】:2019-04-15 22:30:13
【问题描述】:

我正在尝试 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! 我是春天的新手。请帮忙。

【问题讨论】:

  • 你检查答案了吗?

标签: spring spring-data-jpa


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2017-04-21
    • 1970-01-01
    • 1970-01-01
    • 2018-12-14
    • 1970-01-01
    • 1970-01-01
    • 2018-08-16
    • 2018-09-05
    • 1970-01-01
    相关资源
    最近更新 更多