adding pagination for transaction controller

This commit is contained in:
2025-07-24 23:51:31 +02:00
parent 75b1564faa
commit 5bbff964e2
5 changed files with 13547 additions and 4978 deletions

View File

@@ -10,6 +10,8 @@ import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
@@ -182,8 +184,8 @@ public class TransactionService {
return transaction;
}
public List<Transaction> findAll(Specification<Transaction> spec) {
return transactionRepository.findAll(spec, Sort.by(Sort.Direction.ASC, "createdAt"));
public Page<Transaction> findAll(Specification<Transaction> spec, Pageable pageable) {
return transactionRepository.findAll(spec, pageable);
}
public Transaction save(Transaction transaction){