I'm struggling with making order parametrised. The best would be to have
... order by :orderColumn :orderDirection ...
Is it even possible to turn:
@Query("select * from Document where folderId = :folderId AND documentType = :documentType"
+ " order by created desc limit :limit")
List<Document> findByFolderIdAndDocumentTypeOrderByWithLimit(Long folderId, String documentType,
String orderColumn, Integer limit);
Into:
@Query("select * from Document where folderId = :folderId AND documentType = :documentType"
+ " order by :orderColumn desc limit :limit")
List<Document> findByFolderIdAndDocumentTypeOrderByWithLimit(Long folderId, String documentType,
String orderColumn, Integer limit);
I'm using spring-data-jdbc 1.1.3.REELASE version. Even doing it for just column name would help me a lot.