I got to grips with using Spring Data JPA however I stumbled upon an issue, searched all the net but still didn't find an answer. I got the repository working and even the paging and sorting. However, it seems that when I do the same, but specifying a named query in the @Query annotation, rather than letting Spring generate the query at runtime, the sortable part of the Pageable object is completely ignored. I can confirm this as the query generated by Hibernate does not have an "ORDER BY" clause in the latter case.
public interface TransactionRepository extends JpaRepository<Transaction, Long>
{
@Query(name = "Transaction.findParentTransactionsByStatus", countName = "Transaction.findCountParentTransactionsByStatus")
public Page<Transaction> findParentTransactionsByStatus(@Param(value = "status") TransactionStatus status, Pageable pageable);
Any ideas?