springcloud-community / springcloud-comment

0 stars 0 forks source link

post/2022-05/rewrite-query-spring-data-jpa/ #8

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

How to rewrite a query in Spring Data JPA? - Spring Cloud

Spring Data Jpa 3.0.0-SNAPSHOT provides the QueryRewriter interface that can be used to rewritten queries in @Query.

https://www.springcloud.io/post/2022-05/rewrite-query-spring-data-jpa/

RakhimDeSanta commented 1 year ago

How can I write a query if i want to order the result set by multiple columns and multiple directions ? For example: SELECT p from Product ORDER BY name ASC, price DESC, updated_at DESC