I'm aware of this question, but using org.springframework.data:spring-data-jpa:1.7.0.RELEASE
I'm still having the same issue (Either use @Param on all parameters except Pageable and Sort typed once, or none at all!
). My class is:
public interface BalanceHistoryRepository extends JpaRepository<BalanceHistory, Long> {
@Query("select bh from BalanceHistory bh where bh.account.id = :idAccount")
public BalanceHistory findCurrentBalanceByAccountNumber(PageRequest pageCriteira, @Param("idAccount") long idAccount);
}
Edit
Call:
Pageable page = new PageRequest(0, 1, Sort.Direction.DESC, "date");
BalanceHistory bh = balanceHistoryRepository.findCurrentBalanceByAccountNumber(1,page);
Method:
@Query("select bh from BalanceHistory bh where bh.account.id = :idAccount")
public BalanceHistory findCurrentBalanceByAccountNumber(@Param("idAccount") long idAccount, Pageable pageCriteira);