Package com.skava.auth.repository
Interface UserRoleRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserRole,
,Long> org.springframework.data.jpa.repository.JpaRepository<UserRole,
,Long> org.springframework.data.repository.ListCrudRepository<UserRole,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<UserRole,
,Long> org.springframework.data.repository.PagingAndSortingRepository<UserRole,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<UserRole>
,org.springframework.data.repository.Repository<UserRole,
Long>
public interface UserRoleRepository
extends org.springframework.data.jpa.repository.JpaRepository<UserRole,Long>
Repository class to represent the data access layer of the `user_role` entity.
- Author:
- Infosys Equinox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
UserRoleProjection interface. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<UserRole>
findAll
(org.springframework.data.jpa.domain.Specification<UserRole> specification, org.springframework.data.domain.Pageable pageRequest) findAll
(org.springframework.data.jpa.domain.Specification<UserRole> specification, org.springframework.data.domain.Sort sort) findAllByRoleName
(String roleName) findAllByUserId
(Long userId) This method return roles of user in all business.findAllByUserIdAndBusinessId
(Long userId, Long businessId) This method return roles of user in the business.findAllByUserIdAndCollectionId
(Long userId, Long collectionId) findAllUserRolesAndPrivilegesByUserIdAndCollectionId
(Long userId, Long collectionId) findByUserIdAndRoleName
(Long userId, String roleName) findByUserIdAndRoleNameIn
(Long userId, List<String> roleName) 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
-
findByUserIdAndRoleName
-
findByUserIdAndRoleNameIn
-
findAllByUserIdAndCollectionId
-
findAllByRoleName
-
findAll
-
findAll
-
findAll
-
findAllByUserIdAndBusinessId
This method return roles of user in the business. -
findAllByUserId
This method return roles of user in all business. -
findAllUserRolesAndPrivilegesByUserIdAndCollectionId
@Query(value="select p.id as privilegeid, p.entity as entity, p.service as privilegeservice, p.action as action, u_r.collection_id as collectionid , r.type as type , u_r.business_id as businessid, u_r.service_collection_id as servicecollectionid, u_r.service as roleservice, u_r.attributes as attribute, u_r.role_name as rolename, u_r.user_id as userId, u_r.account_id as accountId from ( ( user_role u_r LEFT JOIN role r on ( (u_r.business_id = r.business_id or r.business_id = 0) and (u_r.collection_id = r.collectionId or r.collectionId = 0) and u_r.role_name = r.name ) ) LEFT JOIN ( role_privilege r_p INNER JOIN privilege p on (r_p.privilege_id = p.id) ) on ( r_p.role_id = r.id ) ) where ( u_r.user_id = :userId and u_r.collection_id = :collectionId )", nativeQuery=true) List<UserRoleRepository.UserRolePrivilegeProjection> findAllUserRolesAndPrivilegesByUserIdAndCollectionId(@Param("userId") Long userId, @Param("collectionId") Long collectionId)
-