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 TypeMethodDescriptionboolean
existsByEmailAndIdIsNot
(String email, Long id) Checks whether a user with the specified email exists.boolean
existsByPhoneAndIdIsNot
(String phone, Long id) Checks whether a user with the specified phone exists.findByEmail
(String email) 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
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. otherwisefalse
-
existsByPhoneAndIdIsNot
Checks whether a user with the specified phone exists.- Parameters:
phone
- the email of the userid
- the id of the user- Returns:
true
if a user with this phone exists. otherwisefalse
-
findByEmail
Retrieves user by his email.- Parameters:
email
- the email of the user- Returns:
- an
Optional
containing the user if found, otherwise empty
-
findByVerificationToken
Retrieves user by his verification token.- Parameters:
verificationToken
- the verification token of the user- Returns:
- an
Optional
containing the user if found, otherwise empty
-