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 Summary
Modifier and TypeMethodDescriptionvoiddelete(@NonNull VerificationToken verificationToken) Removes the givenVerificationTokenfrom the database table.voiddeleteByActor(@NonNull Actor actor) Removes theVerificationTokenof the givenVerificationToken.actorfrom the database.@NonNull Optional<VerificationToken> findByActorUserName(@NonNull String userName) @NonNull Optional<VerificationToken> findByToken(@NonNull String token) Fetches theVerificationTokenwith the givenVerificationToken.tokenfrom the database.@NonNull Optional<VerificationToken> findByTokenAndActorUserName(@NonNull String token, @NonNull String userName) Fetches theVerificationTokenthat matchesvoidsave(@NonNull VerificationToken verificationToken) Stores the givenVerificationTokenin the database table.Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll, findAll
-
Method Details
-
findByToken
Fetches theVerificationTokenwith the givenVerificationToken.tokenfrom 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) - 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
VerificationTokenthat matches- the given
VerificationToken.tokenand - the
VerificationToken.actorthat has the givenActor.userName
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.)
- the given
-
save
Stores the givenVerificationTokenin the database table.- Parameters:
verificationToken- The VerificationToken that shall be stored permanently.
-
delete
Removes the givenVerificationTokenfrom the database table.- Parameters:
verificationToken- The VerificationToken that shall no longer be stored in the database.
-
deleteByActor
Removes theVerificationTokenof the givenVerificationToken.actorfrom the database.- Parameters:
actor- The Actor whose VerificationToken shall be deleted.
-