2

I am trying to write a native query and pagination in eclipse link + JPA for PostgreSQL

but I'm getting exceptions :

Here is the code what I tried :

@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}") 

and I followed this link but no luck :

Spring Data and Native Query with pagination

any help appreciated

when I use second query I got this exception :

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]
Developer
  • 2,389
  • 4
  • 11
  • 17

0 Answers0