Package org.openiam.esb.repository
Interface RoleRepository
-
- All Superinterfaces:
AbstractEntitlementPolicyRepository<RoleEntity,String>,AbstractEntityRepository<RoleEntity,String>,AbstractKeyEntityCustomRepository<RoleEntity,String>,AbstractKeyEntityRepository<RoleEntity,String>,AbstractKeyNameEntityCustomRepository<RoleEntity,String>,AbstractKeyNameEntityRepository<RoleEntity,String>,AbstractMetadataTypeRepository<RoleEntity,String>,AbstractMetadataTypeRepositoryCustom<RoleEntity,String>,org.springframework.data.repository.CrudRepository<RoleEntity,String>,EvictableCustomRepository<RoleEntity>,FindBeansRepositoryCustom<RoleEntity,RoleSearchBean>,IDetacheableEntityRepository<RoleEntity,String>,org.springframework.data.jpa.repository.JpaRepository<RoleEntity,String>,org.springframework.data.jpa.repository.JpaSpecificationExecutor<RoleEntity>,org.springframework.data.repository.PagingAndSortingRepository<RoleEntity,String>,org.springframework.data.repository.query.QueryByExampleExecutor<RoleEntity>,org.springframework.data.repository.Repository<RoleEntity,String>,RoleRepositoryCustom
@Repository public interface RoleRepository extends AbstractEntitlementPolicyRepository<RoleEntity,String>, RoleRepositoryCustom, IDetacheableEntityRepository<RoleEntity,String>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>collectPolicyIdsByRoleIds(Collection<String> ids)intdoesUserLinkedWithRole(String roleId, String userId)List<RoleEntity>findByManagedSystemId(String managedSysId)List<String>getAllIds()org.springframework.data.domain.Page<RoleEntity>getDetachedForUser(String userId, String name, org.springframework.data.domain.Pageable page)method is used to detect all user's role that are not linked with any resources.List<CountXrefDBWrapper>numberOfUsersForAllRoles()List<CountXrefDBWrapper>numberOfUsersForRoles(Collection<String> roleIds)-
Methods inherited from interface org.openiam.esb.repository.AbstractEntityRepository
getPageable
-
Methods inherited from interface org.openiam.esb.repository.custom.AbstractKeyEntityCustomRepository
findByIdIn
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
-
Methods inherited from interface org.openiam.esb.repository.custom.EvictableCustomRepository
evict, evict, evict
-
Methods inherited from interface org.openiam.esb.repository.custom.FindBeansRepositoryCustom
count, find, find, find, getByExample, getByExample, isValidSearchBean
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOne
-
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
-
Methods inherited from interface org.openiam.esb.repository.custom.RoleRepositoryCustom
findForSynchronizationRequest
-
-
-
-
Method Detail
-
findByManagedSystemId
@Query("SELECT m FROM RoleEntity m WHERE m.managedSystem.id = :managedSysId") List<RoleEntity> findByManagedSystemId(@Param("managedSysId") String managedSysId)
-
getDetachedForUser
@Query("SELECT m FROM RoleEntity m JOIN m.users u WHERE lower (m.name) LIKE lower(concat(\'%\', :name,\'%\')) AND u.memberEntity.id=:userId AND m.resources is empty order by m.name") org.springframework.data.domain.Page<RoleEntity> getDetachedForUser(@Param("userId") String userId, @Param("name") String name, org.springframework.data.domain.Pageable page)method is used to detect all user's role that are not linked with any resources.- Specified by:
getDetachedForUserin interfaceIDetacheableEntityRepository<RoleEntity,String>- Parameters:
userId- - id of User to check detached rolesname- - name for case INSENSITIVE CONTAINS match search.page- -Pageablefor paging- Returns:
- -
Pagewith results;
-
doesUserLinkedWithRole
@Query("SELECT count(m) FROM UserToRoleMembershipXrefEntity m join m.entity r join m.memberEntity u WHERE r.id=:roleId and u.id=:userId") int doesUserLinkedWithRole(@Param("roleId") String roleId, @Param("userId") String userId)
-
numberOfUsersForRoles
@Query("SELECT new CountXrefDBWrapper (r.id, count(distinct u.id), r.maxUserNumber, \'Role\') FROM RoleEntity r left join r.users u WHERE r.id in (:roleIds) group by r.id, r.maxUserNumber") List<CountXrefDBWrapper> numberOfUsersForRoles(@Param("roleIds") Collection<String> roleIds)
-
numberOfUsersForAllRoles
@Query("SELECT new CountXrefDBWrapper (r.id, count(distinct u.id), r.maxUserNumber, \'Role\') FROM RoleEntity r left join r.users u group by r.id, r.maxUserNumber") List<CountXrefDBWrapper> numberOfUsersForAllRoles()
-
collectPolicyIdsByRoleIds
@Query("SELECT r.policy.id FROM RoleEntity r WHERE r.id IN :ids") Set<String> collectPolicyIdsByRoleIds(@Param("ids") Collection<String> ids)
-
-