Interface RefreshTokenRepository

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

public interface RefreshTokenRepository extends org.springframework.data.jpa.repository.JpaRepository<RefreshToken,Long>
Repository for persisting and querying RefreshToken records.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes all refresh tokens associated with the given user.
    Finds a refresh token by its token string value.

    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

    • findByToken

      Optional<RefreshToken> findByToken(String token)
      Finds a refresh token by its token string value.
      Parameters:
      token - the refresh token string
      Returns:
      an optional containing the matching refresh token, if found
    • deleteByUser

      void deleteByUser(User user)
      Deletes all refresh tokens associated with the given user.
      Parameters:
      user - the user whose refresh tokens should be removed