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>

@Repository public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    findByEmail(String userEmail)
     
     
    findNextPage(Long lastId, org.springframework.data.domain.Pageable pageable)
     
     
    void
     
    boolean
     

    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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findUserByEmail

      @Query("SELECT u FROM User u WHERE u.userEmail = :userEmail") User findUserByEmail(@Param("userEmail") String userEmail)
    • findByEmail

      @Query("SELECT u FROM User u WHERE u.userEmail = :userEmail") Optional<User> findByEmail(String userEmail)
    • findByPhone

      @Query("SELECT u FROM User u WHERE u.userPhone = :phone") Optional<User> findByPhone(String phone)
    • userExistsByEmail

      @Query("SELECT CASE WHEN COUNT(u) > 0 THEN true ELSE false END FROM User u WHERE u.userEmail = :userEmail") boolean userExistsByEmail(@Param("userEmail") String userEmail)
    • findNextPage

      @Query("SELECT u FROM User u WHERE u.userId > :lastId ORDER BY u.userId ASC") List<User> findNextPage(@Param("lastId") Long lastId, org.springframework.data.domain.Pageable pageable)
    • updateLoginTime

      @Modifying @Query("UPDATE User u SET u.lastLoginTime = CURRENT_TIMESTAMP WHERE u.userEmail = :email") void updateLoginTime(@Param("email") String email)