Interface CardRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Card,UUID>, org.springframework.data.jpa.repository.JpaRepository<Card,UUID>, org.springframework.data.repository.ListCrudRepository<Card,UUID>, org.springframework.data.repository.ListPagingAndSortingRepository<Card,UUID>, org.springframework.data.repository.PagingAndSortingRepository<Card,UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<Card>, org.springframework.data.repository.Repository<Card,UUID>

@Repository public interface CardRepository extends org.springframework.data.jpa.repository.JpaRepository<Card,UUID>
Repository interface for managing cards in the database. It extends JpaRepository, providing basic CRUD operations and JPA-related methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    Finds all cards associated with a specific bank account ID.
    findByAccountIdAndId(UUID accountId, UUID cardId)
    Finds a specific card by its account ID and card ID.

    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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    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

    • findAllByAccountId

      Optional<List<Card>> findAllByAccountId(UUID id)
      Finds all cards associated with a specific bank account ID.
      Parameters:
      id - The ID of the bank account.
      Returns:
      An optional list of cards linked to the provided bank account ID.
    • findByAccountIdAndId

      Optional<Card> findByAccountIdAndId(UUID accountId, UUID cardId)
      Finds a specific card by its account ID and card ID.
      Parameters:
      accountId - The ID of the bank account associated with the card.
      cardId - The ID of the card to find.
      Returns:
      An optional card matching the provided account ID and card ID.