Interface AccountLedgerRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<AccountLedgerEntry, Long>, org.springframework.data.jpa.repository.JpaRepository<AccountLedgerEntry, Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<AccountLedgerEntry>, org.springframework.data.repository.ListCrudRepository<AccountLedgerEntry, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<AccountLedgerEntry, Long>, org.springframework.data.repository.PagingAndSortingRepository<AccountLedgerEntry, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<AccountLedgerEntry>, org.springframework.data.repository.Repository<AccountLedgerEntry, Long>
@Repository
public interface AccountLedgerRepository
extends org.springframework.data.jpa.repository.JpaRepository<AccountLedgerEntry, Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<AccountLedgerEntry>
Data-access layer for
AccountLedgerEntry entities.- Version:
- 3.0.5
- Author:
- Stephen Prizio
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T> -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByAccount(Account account) Deletes all ledger entries for the givenAccount.voiddeleteByPosition(Position position) Deletes all ledger entries for the givenPosition.Returns all ledger entries for the givenAccount.findAllByTransaction(Transaction transaction) Returns every ledger entry linked to the givenTransaction.Returns the latest ledger entry for the givenAccount.findFirstByPosition(Position position) Returns a ledger entry for the givenPosition.findFirstByTransaction(Transaction transaction) Returns a ledger entry for the givenTransaction.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, updateMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAllByAccountOrderByOccurredAtAscSequenceNumberAsc
Returns all ledger entries for the givenAccount.- Parameters:
account-Account- Returns:
ListofAccountLedgerEntry
-
findAllByAccountsOrderByOccurredAtAscSequenceNumberAsc
@Query("SELECT ale\nFROM AccountLedgerEntry ale\nWHERE ale.account IN :accounts\nORDER BY ale.occurredAt ASC, ale.account.id ASC, ale.sequenceNumber ASC\n") List<AccountLedgerEntry> findAllByAccountsOrderByOccurredAtAscSequenceNumberAsc(@Param("accounts") List<Account> accounts) - Parameters:
accounts-ListofAccounts- Returns:
ListofAccountLedgerEntry
-
findFirstByAccountOrderByOccurredAtDescSequenceNumberDesc
Optional<AccountLedgerEntry> findFirstByAccountOrderByOccurredAtDescSequenceNumberDesc(Account account) Returns the latest ledger entry for the givenAccount.- Parameters:
account-Account- Returns:
OptionalAccountLedgerEntry
-
findFirstByPosition
Returns a ledger entry for the givenPosition.- Parameters:
position-Position- Returns:
OptionalAccountLedgerEntry
-
findFirstByTransaction
Returns a ledger entry for the givenTransaction.- Parameters:
transaction-Transaction- Returns:
OptionalAccountLedgerEntry
-
findAllByTransaction
Returns every ledger entry linked to the givenTransaction.- Parameters:
transaction-Transaction- Returns:
ListofAccountLedgerEntry
-
deleteByPosition
-
deleteByAccount
-