Interface VerificationTokenRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<VerificationTokenEntity,
,Long> org.springframework.data.jpa.repository.JpaRepository<VerificationTokenEntity,
,Long> org.springframework.data.repository.ListCrudRepository<VerificationTokenEntity,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<VerificationTokenEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<VerificationTokenEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<VerificationTokenEntity>
,org.springframework.data.repository.Repository<VerificationTokenEntity,
Long>
public interface VerificationTokenRepository
extends org.springframework.data.jpa.repository.JpaRepository<VerificationTokenEntity,Long>
Repository interface for managing
VerificationTokenEntity
entities in the persistence layer.
This interface extends JpaRepository
to provide basic CRUD functionality for VerificationTokenEntity
entities,
such as saving, updating, deleting, and retrieving verification token records from the database.
-
Method Summary
Modifier and TypeMethodDescriptionfindByToken
(String token) Retrieves a verification token by its token value.findByUserId
(Long userId) Retrieves a verification token by the user ID associated with it.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
Retrieves a verification token by its token value.This method returns an
Optional
containing theVerificationTokenEntity
associated with the given token. If no token is found, an emptyOptional
is returned.- Parameters:
token
- the token value of the verification token to retrieve- Returns:
- an
Optional
containing theVerificationTokenEntity
if found, otherwise an emptyOptional
-
findByUserId
Retrieves a verification token by the user ID associated with it.This method returns an
Optional
containing theVerificationTokenEntity
associated with the given user ID. If no token is found for the specified user, an emptyOptional
is returned.- Parameters:
userId
- the ID of the user whose verification token is to be retrieved- Returns:
- an
Optional
containing theVerificationTokenEntity
if found, otherwise an emptyOptional
-