Interface AccountRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Account,
,Long> org.springframework.data.jpa.repository.JpaRepository<Account,
,Long> org.springframework.data.repository.PagingAndSortingRepository<Account,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Account>
,org.springframework.data.repository.Repository<Account,
Long>
-
Method Summary
Modifier and TypeMethodDescriptionfindAccountByAccountNumber
(String accountNumber) Find an account by its account number.findAccountByUserId
(Long userId) Finds an account by user ID.findAccountByUserIdAndAccountType
(Long userId, AccountType accountType) Find an account by user ID and account type.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAccountByUserIdAndAccountType
Find an account by user ID and account type.- Parameters:
userId
- The ID of the user.accountType
- The type of the account.- Returns:
- An optional containing the account if found, or empty if not found.
-
findAccountByAccountNumber
Find an account by its account number.- Parameters:
accountNumber
- The account number to search for.- Returns:
- An optional containing the found account, or an empty optional if no account was found.
-
findAccountByUserId
Finds an account by user ID.- Parameters:
userId
- the ID of the user- Returns:
- an optional account object
-