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 TypeMethodDescriptionvoiddeleteByUser(User user) Deletes all refresh tokens associated with the given user.findByToken(String token) 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, 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.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
-
findByToken
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
Deletes all refresh tokens associated with the given user.- Parameters:
user- the user whose refresh tokens should be removed
-