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 Type
    Method
    Description
    void
    expirePasswordResets(LocalDateTime currentTimestamp, LocalDateTime requestedBefore)
    Expire the password resets.
    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, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, 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, 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 time
      requestedBefore - the date and time to expire password resets after
    • findAllByUsernameAndStatus

      List<PasswordReset> findAllByUsernameAndStatus(String username, PasswordResetStatus status)
      Retrieve the password reset with the specified status for the user.
      Parameters:
      username - the username for the user
      status - the password reset status
      Returns:
      the password resets with the specified status for the user