分页和幼稚查询+ Eclipse链接

时间:2019-02-20 08:52:23

标签: java postgresql pagination spring-data-jpa nativequery

我正在尝试在Eclipse链接+ JPA for PostgreSQL中编写本机查询和分页

但是我遇到了异常:

这是我尝试的代码:

@Query(nativeQuery = true, value= "select a.* from rqst a LEFT OUTER JOIN table_b b ON a.id= b.id where a.code='abc' ORDER BY /*#pagable*/") 

@Query(nativeQuery = true, value= "select a.* from rqst a LEFT OUTER JOIN table_b b ON a.id= b.id where a.code='abc' ORDER BY ?#{#pageable}") 

我点击了此链接,但没有运气:

Spring Data and Native Query with pagination

任何帮助表示赞赏

当我使用第二个查询时,出现了这个异常:

Can't infer the SQL type to use for an instance of org.springframework.data.domain.PageRequest. Use setObject() with an explicit Types value to specify the type to use.
    at org.postgresql.jdbc.PgPreparedStatement.setObject(PgPreparedStatement.java:1039) ~[postgresql-9.4.1208.jar:9.4.1208]

0 个答案:

没有答案