Package com.mindstore.backend.repository
Interface UserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<User,,Long> org.springframework.data.jpa.repository.JpaRepository<User,,Long> org.springframework.data.repository.ListCrudRepository<User,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<User,,Long> org.springframework.data.repository.PagingAndSortingRepository<User,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<User>,org.springframework.data.repository.Repository<User,Long>
public interface UserRepository
extends org.springframework.data.jpa.repository.JpaRepository<User,Long>
user repository with extra functions
-
Method Summary
Modifier and TypeMethodDescriptionfindByEmail(String email) function to find a user by emailgetUserWithMailAdressAndSpecificCreatedAtDate(String email, LocalDateTime createdAt) function to select users by mail who were created before a certain dateMethods 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
-
findByEmail
function to find a user by email- Parameters:
email- string- Returns:
- an optional User
-
getUserWithMailAdressAndSpecificCreatedAtDate
@Query("SELECT u FROM User u WHERE u.email = :email AND u.createdAt > :createdAt") User getUserWithMailAdressAndSpecificCreatedAtDate(@Param("email") String email, @Param("createdAt") LocalDateTime createdAt) function to select users by mail who were created before a certain date- Parameters:
email- stringcreatedAt- localdatetime- Returns:
- a user (or none)
-