How did Mandar Sort view URL in native pagination query?

Asked

Viewed 69 times

1

The structure below works perfectly, but when I send after the input and pagination data the command Sort it from the Sql error, which I need to put in the query to accept the Sort for the field I want ?

I am sending this data via URL: dadosEntrada?page=0&size=10&sort=campoDoSort

@Query(value = "select i.* " + "from tabela1 r  "
+ "join tabela2 ri on ri.chavetabela2 = r.chavetabela1  "
+ "join tabela3 i on i.chavetabela3 = ri.chavetabela2 "
+ "where r.campo1 = ?1 or i.campo2 = ?2 /*#pageable*/ ",
 countQuery = "SELECT count(*) "
+ "from tabela1 r  "
+ "join tabela2 ri on ri.chavetabela2 = r.chavetabela1  "
+ "join tabela3 i on i.chavetabela3 = ri.chavetabela2 "
+ "where r.campo1 = ?1 or i.campo2 = ?2  ",
   nativeQuery = true)
public Page<ClasseModeloTabela> testePaginacaoQueryJoin(Long campo1, Long campo2, Pageable pageable);
  • Is oracle the database? What is the SQL error? Can you include the SQL generated in both cases? See if something like where r.campo1 = ?1 or i.campo2 = ?2 ORDER BY /*#pageable*/ does not generate the pagination and ordering section correctly.

  • yes the bank is Oracle, tried the command (ORDER BY /#pageable/), but it of Sqlgrammarexception error

  • If you hear anything new, put it there, I’ve tried everything but I haven’t found the answer.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.