I try to order my custom query with a custom parameter like so:
@Query("select * from person where firstname = :name" + " order by :order")
List<Customer> findByFirstNameCustomQuery2(@Param("name") String name, Pageable page,
@Param("order") String order);
but it does not work.
Does someone know how to use "order by" as parameter inside a @Query?
remark: As answered below I created a github repository. You can find it here: https://github.com/kremerkp/spring-data-jdbc-pageable-h2.
The CustomerRepository is having five functions. "findByLastName" is a full-working example (sortable and pageable) that is using query functions.
In my real project I have a query that is to complex to use it with query functions, so I need to get the result with a custom query.