public interface UserRepository extends org.springframework.data.repository.PagingAndSortingRepository<UserEntity,String>
Optional<UserEntity> findFirstByLogin(String login)
login - user loginOptional<UserEntity> findByEmailOrLogin(String email, String login)
email - user email@Modifying @Query(value="update UserEntity u set u.systemBlocked=?2 where u.branch=?1") void updateSystemBlockedStatus(String branchId, boolean status)
@Modifying @Query(value="update UserEntity u set u.blocked=?2 where u.branch=?1") void updateBlockedStatus(String branchId, boolean status)
@Modifying @Query(value="update UserEntity u set u.systemBlocked=?2 where u.id=?1") void updateUserSystemBlockedStatus(String userId, boolean status)
@Modifying @Query(value="update UserEntity u set u.blocked=?2 where u.id=?1") void updateUserBlockedStatus(String userId, boolean status)
@Query(value="select distinct u from UserEntity u where u.branch like ?1% and u.branch like %?2% and u.login like %?3% and ?4 member of u.userRoles and u.systemBlocked=false ") List<UserEntity> findBranchIdsByMultipleParameters(String countryCode, String branchId, String branchLogin, UserRole role)
org.springframework.data.domain.Page<UserEntity> findByBranchInAndLoginContainingAndUserRolesInAndBlockedInAndSystemBlockedFalse(Collection<String> branch, String login, Collection<UserRole> userRoles, Collection<Boolean> blocked, org.springframework.data.domain.Pageable pageable)
org.springframework.data.domain.Page<UserEntity> findByUserRolesIn(Collection<UserRole> userRoles, org.springframework.data.domain.Pageable pageable)
int countByBranch(String branch)
branch - branchOptional<UserEntity> findByLoginAndEmail(String login, String email)
@Query(value="select distinct u from UserEntity u join u.accountAccesses a where a.iban = ?1") List<UserEntity> findUsersByIban(String iban)
@Query(value="select distinct u from UserEntity u join u.accountAccesses a where a.iban = ?1 and a.accessType = ?2") List<UserEntity> findOwnersByIban(String iban, AccessType accessType)
@Query(value="select distinct u from UserEntity u join u.accountAccesses a where a.accountId = ?1 and a.accessType = ?2") List<UserEntity> findOwnersByAccountId(String accountId, AccessType accessType)
List<UserEntity> findByBranch(String branchId)
List<UserEntity> findByBranchAndCreatedAfter(String branchId, LocalDateTime created)
@Query(value="select u from UserEntity u where u.login=?1 or u.email=?1") Optional<UserEntity> findByLoginOrEmail(String loginOrEmail)
Copyright © 2020. All rights reserved.