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>

@Repository public interface AccountRepository extends org.springframework.data.jpa.repository.JpaRepository<Account,Long>
Repository for the account data.
See Also:
  • JpaRepository
Implementation Note:
Keywords
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes an account by its api key
    boolean
    Checks if an account with the given username exists.
    Finds an account by its api key

    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

    • findByApiKey

      Optional<Account> findByApiKey(String apiKey)
      Finds an account by its api key
      Parameters:
      apiKey - the api key to search for
      Returns:
      the account with the given api key
    • deleteByApiKey

      void deleteByApiKey(String apiKey)
      Deletes an account by its api key
      Parameters:
      apiKey - the api key to delete
    • existsByCredStartsWith

      boolean existsByCredStartsWith(String cred)
      Checks if an account with the given username exists.
      Parameters:
      cred - the username to search for
      Returns:
      true if an account starts with the given username