Interface DataUserRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<UserEntity,Long>, org.springframework.data.repository.ListCrudRepository<UserEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<UserEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<UserEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<UserEntity>, org.springframework.data.repository.Repository<UserEntity,Long>

@Repository public interface DataUserRepository extends org.springframework.data.jpa.repository.JpaRepository<UserEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<UserEntity,Long>
JPA repository for managing UserEntity entities in the database. Extends JpaRepository and PagingAndSortingRepository to provide CRUD operations and pagination.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether a user with the specified email exists.
    boolean
    Checks whether a user with the specified phone exists.
    Retrieves user by his email.
    findByVerificationToken(String verificationToken)
    Retrieves user by his verification token.

    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

    • existsByEmailAndIdIsNot

      boolean existsByEmailAndIdIsNot(String email, Long id)
      Checks whether a user with the specified email exists.
      Parameters:
      email - the email of the user * @param id the id of the user
      Returns:
      true if a user with this email exists. otherwise false
    • existsByPhoneAndIdIsNot

      boolean existsByPhoneAndIdIsNot(String phone, Long id)
      Checks whether a user with the specified phone exists.
      Parameters:
      phone - the email of the user
      id - the id of the user
      Returns:
      true if a user with this phone exists. otherwise false
    • findByEmail

      Optional<UserEntity> findByEmail(String email)
      Retrieves user by his email.
      Parameters:
      email - the email of the user
      Returns:
      an Optional containing the user if found, otherwise empty
    • findByVerificationToken

      Optional<UserEntity> findByVerificationToken(String verificationToken)
      Retrieves user by his verification token.
      Parameters:
      verificationToken - the verification token of the user
      Returns:
      an Optional containing the user if found, otherwise empty