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>
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
     
     

    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

    • findByUsernameOrEmail

      @Query("SELECT u FROM User u WHERE u.username = :identifier OR u.email = :identifier") Optional<User> findByUsernameOrEmail(@Param("identifier") String identifier)
    • findFirst

      @Query("SELECT u FROM User u ORDER BY u.id ASC") Optional<User> findFirst()
    • findByVerificationToken

      @Query("SELECT u FROM User u WHERE u.verificationToken = :token") Optional<User> findByVerificationToken(String token)
    • findByEmail

      Optional<User> findByEmail(String email)
    • findUsernameEmailId

      @Query("SELECT new org.bh_foundation.e_sign.dto.UserDto(u.id, u.username, u.email) FROM User u ORDER BY u.username ASC") List<UserDto> findUsernameEmailId()