Package africa.absa.inception.security
Interface PasswordResetRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<PasswordReset,,PasswordResetId> org.springframework.data.jpa.repository.JpaRepository<PasswordReset,,PasswordResetId> org.springframework.data.repository.PagingAndSortingRepository<PasswordReset,,PasswordResetId> org.springframework.data.repository.query.QueryByExampleExecutor<PasswordReset>,org.springframework.data.repository.Repository<PasswordReset,PasswordResetId>
public interface PasswordResetRepository
extends org.springframework.data.jpa.repository.JpaRepository<PasswordReset,PasswordResetId>
The PasswordResetRepository interface declares the repository for the
PasswordReset domain type.
- Author:
- Marcus Portmann
-
Method Summary
Modifier and TypeMethodDescriptionvoidexpirePasswordResets(LocalDateTime currentTimestamp, LocalDateTime requestedBefore) Expire the password resets.findAllByUsernameAndStatus(String username, PasswordResetStatus status) Retrieve the password reset with the specified status for the user.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, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Method Details
-
expirePasswordResets
@Modifying @Query("update PasswordReset pr set pr.expired = :currentTimestamp, pr.status = 3 where pr.status = 1 and pr.requested < :requestedBefore") void expirePasswordResets(@Param("currentTimestamp") LocalDateTime currentTimestamp, @Param("requestedBefore") LocalDateTime requestedBefore) Expire the password resets.- Parameters:
currentTimestamp- the current date and timerequestedBefore- the date and time to expire password resets after
-
findAllByUsernameAndStatus
Retrieve the password reset with the specified status for the user.- Parameters:
username- the username for the userstatus- the password reset status- Returns:
- the password resets with the specified status for the user
-