Interface UserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<User,,String> org.springframework.data.jpa.repository.JpaRepository<User,,String> org.springframework.data.jpa.repository.JpaSpecificationExecutor<User>,org.springframework.data.repository.PagingAndSortingRepository<User,,String> org.springframework.data.repository.query.QueryByExampleExecutor<User>,org.springframework.data.repository.Repository<User,String>
@Repository
public interface UserRepository
extends org.springframework.data.jpa.repository.JpaRepository<User,String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<User>
User repository.
-
Method Summary
Modifier and TypeMethodDescriptionexistsByEmail(String email) Check if user exist by email.findAllByCompanyIdAndActiveTrue(Integer companyId) List of company users.findByCompanyIdAndUserFatherIsNull(Integer companyId) Find User Father for company Id.findByEmailAndActiveTrue(String email) Find user by email.findByIdAndCompanyIdAndActiveTrue(String id, Integer companyId) Find User for id and company Id.Methods 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, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOneMethods 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
-
findByEmailAndActiveTrue
Find user by email.- Parameters:
email- user email.- Returns:
- Optional user object.
-
existsByEmail
Check if user exist by email.- Parameters:
email- user email.- Returns:
- exist boolean.
-
findAllByCompanyIdAndActiveTrue
List of company users.- Parameters:
companyId- company identifier.- Returns:
- users list.
-
findByCompanyIdAndUserFatherIsNull
Find User Father for company Id.- Parameters:
companyId- company identifier.- Returns:
- User father.
-
findByIdAndCompanyIdAndActiveTrue
Find User for id and company Id.- Parameters:
id- user identifier.companyId- company identifier.- Returns:
- User.
-