Open
Description
kremerkp opened DATAJDBC-589 and commented
I try to add an dynamicly "order by" clause by passing a parameter inside a custom query. Limit and offset are working fine as parameters, only the order by is not recognized
Example:
// code public interface CustomerRepository extends PagingAndSortingRepository<Customer, Long>
@Query("select * from person where firstname = :name" + " order by :order")
List<Customer> findByFirstNameCustomQuery(@Param("name") String name,
Pageable page, @Param("order") String order);
The query that I normaly use is more complex, so that I wont be able to use query creation from method names.
Is there a workaround or will it be "fixed/added" in a future release?
I also added a small GitHub Repo do demonstrate the problem;
https://github.com/kremerkp/spring-data-jdbc-pageable-h2
Reference URL: https://stackoverflow.com/questions/63285038/spring-data-customized-query-with-order-parmeter-nor-working