Interface TokenRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Token,,Long> org.springframework.data.jpa.repository.JpaRepository<Token,,Long> org.springframework.data.repository.ListCrudRepository<Token,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<Token,,Long> org.springframework.data.repository.PagingAndSortingRepository<Token,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Token>,org.springframework.data.repository.Repository<Token,Long>
@Repository
public interface TokenRepository
extends org.springframework.data.jpa.repository.JpaRepository<Token,Long>
This repository provides CRUD operations for the Token entity.
It extends JpaRepository and JpaSpecificationExecutor interfaces.
JpaRepository provides basic CRUD operations while JpaSpecificationExecutor provides
search functionality using specifications.
- Author:
- Trym Hamer Gudvangen
-
Method Summary
Modifier and TypeMethodDescriptionfindTokenByToken(String token) This method retrieves the token object attached to the token value.This method retrieves the token attached to the given id.findTokenByUser_userId(Long userId) This method retrieves the token attached to the given user id.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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findTokenByTokenId
This method retrieves the token attached to the given id.- Parameters:
id- ID of the token, given as a Long object.- Returns:
- Token object
-
findTokenByToken
This method retrieves the token object attached to the token value.- Parameters:
token- Value of the token, given as a String.- Returns:
- Token object
-
findTokenByUser_userId
This method retrieves the token attached to the given user id.- Parameters:
userId- ID of the user, given as a Long object.- Returns:
- Token object
-