Interface VerificationTokenRepository

All Superinterfaces:
org.springframework.data.repository.PagingAndSortingRepository<VerificationToken, Long>, org.springframework.data.repository.Repository<VerificationToken, Long>

@Table(name="verification_tokens") public interface VerificationTokenRepository extends org.springframework.data.repository.PagingAndSortingRepository<VerificationToken, Long>
Fetches/saves VerificationTokens from/to the verification_tokens database table.
  • Method Details

    • findByToken

      @NonNull @NonNull Optional<VerificationToken> findByToken(@NonNull @NonNull String token)
      Fetches the VerificationToken with the given VerificationToken.token from the database.
      Parameters:
      token - The actual value of the VerificationToken object to fetch.
      Returns:
      The VerificationToken with the given value.
    • findByActorUserName

      @NonNull @NonNull Optional<VerificationToken> findByActorUserName(@NonNull @NonNull String userName)
      Fetches the VerificationToken for the VerificationToken.actor that has the given Actor.userName.
      Parameters:
      userName - The user name of the Actor whose VerificationToken shall be returned.
      Returns:
      The VerificationToken for the specified Actor.
      API Note:
      This method returns just one VerificationToken, because there can only be one for an Actor at any given time. (A registration VerificationToken is deleted after the registration is confirmed, and besides those tokens, only EMailVerificationTokens exist.)
    • findByTokenAndActorUserName

      @NonNull @NonNull Optional<VerificationToken> findByTokenAndActorUserName(@NonNull @NonNull String token, @NonNull @NonNull String userName)

      Fetches the VerificationToken that matches

      from the database.

      Parameters:
      token - The actual value of the VerificationToken object to fetch.
      userName - The user name of the Actor whose VerificationToken shall be returned.
      Returns:
      The VerificationToken matching the specified token value and Actor.
      API Note:
      This method returns just one VerificationToken, because there can only be one for an Actor at any given time. (A registration VerificationToken is deleted after the registration is confirmed, and besides those tokens, only EMailVerificationTokens exist.)
    • save

      void save(@NonNull @NonNull VerificationToken verificationToken)
      Stores the given VerificationToken in the database table.
      Parameters:
      verificationToken - The VerificationToken that shall be stored permanently.
    • delete

      void delete(@NonNull @NonNull VerificationToken verificationToken)
      Removes the given VerificationToken from the database table.
      Parameters:
      verificationToken - The VerificationToken that shall no longer be stored in the database.
    • deleteByActor

      @Transactional void deleteByActor(@NonNull @NonNull Actor actor)
      Removes the VerificationToken of the given VerificationToken.actor from the database.
      Parameters:
      actor - The Actor whose VerificationToken shall be deleted.