Package org.openiam.esb.repository
Interface GroupRepository
-
- All Superinterfaces:
AbstractEntityRepository<GroupEntity,String>
,AbstractKeyEntityCustomRepository<GroupEntity,String>
,AbstractKeyEntityRepository<GroupEntity,String>
,AbstractKeyNameEntityCustomRepository<GroupEntity,String>
,AbstractKeyNameEntityRepository<GroupEntity,String>
,AbstractMetadataTypeRepository<GroupEntity,String>
,AbstractMetadataTypeRepositoryCustom<GroupEntity,String>
,org.springframework.data.repository.CrudRepository<GroupEntity,String>
,EvictableCustomRepository<GroupEntity>
,FindBeansRepositoryCustom<GroupEntity,GroupSearchBean>
,GroupRepositoryCustom
,IDetacheableEntityRepository<GroupEntity,String>
,org.springframework.data.jpa.repository.JpaRepository<GroupEntity,String>
,org.springframework.data.jpa.repository.JpaSpecificationExecutor<GroupEntity>
,org.springframework.data.repository.PagingAndSortingRepository<GroupEntity,String>
,org.springframework.data.repository.query.QueryByExampleExecutor<GroupEntity>
,org.springframework.data.repository.Repository<GroupEntity,String>
@Repository public interface GroupRepository extends AbstractMetadataTypeRepository<GroupEntity,String>, GroupRepositoryCustom, IDetacheableEntityRepository<GroupEntity,String>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>
collectPolicyIdsByGroupIds(Collection<String> ids)
int
doesUserLinkedWithGroup(String groupId, String userId)
List<GroupEntity>
findByManagedSystemId(String id)
List<String>
getAllIds()
org.springframework.data.domain.Page<GroupEntity>
getDetachedForUser(String userId, String name, org.springframework.data.domain.Pageable page)
method is used to detect all user's groups that are not linked with any resources.List<EntitlementsDBWrapper>
getGroupsForGroupsByAccessRights(List<String> groupIds, List<String> accessRightIds)
List<EntitlementsDBWrapper>
getGroupsForRolesByAccessRights(List<String> roleIds, List<String> accessRightIds)
List<CountXrefDBWrapper>
numberOfUsersForAllGroups()
List<CountXrefDBWrapper>
numberOfUsersForGroups(Collection<String> groupIds)
-
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.openiam.esb.repository.custom.GroupRepositoryCustom
findForSynchronizationRequest
-
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
-
-
-
-
Method Detail
-
findByManagedSystemId
List<GroupEntity> findByManagedSystemId(String id)
-
getGroupsForGroupsByAccessRights
@Query("SELECT NEW EntitlementsDBWrapper(group.id, r.id, group.name,ug.memberEntity.id,ug.startDate,ug.endDate, ug.description ) FROM GroupToGroupMembershipXrefEntity ug JOIN ug.rights as r JOIN ug.entity as group WHERE ug.memberEntity.id IN (:groupIds) and r.id IN (:accessRightIds)") List<EntitlementsDBWrapper> getGroupsForGroupsByAccessRights(@Param("groupIds") List<String> groupIds, @Param("accessRightIds") List<String> accessRightIds)
-
getGroupsForRolesByAccessRights
@Query("SELECT NEW EntitlementsDBWrapper(group.id, r.id, group.name,ug.entity.id,ug.startDate,ug.endDate, ug.description ) FROM RoleToGroupMembershipXrefEntity ug JOIN ug.rights as r JOIN ug.memberEntity as group WHERE ug.entity.id IN (:roleIds) and r.id IN (:accessRightIds)") List<EntitlementsDBWrapper> getGroupsForRolesByAccessRights(@Param("roleIds") List<String> roleIds, @Param("accessRightIds") List<String> accessRightIds)
-
getDetachedForUser
@Query("SELECT m FROM GroupEntity m left join m.users u left join m.resources r WHERE lower(m.name) LIKE ( lower( concat(\'%\',:name,\'%\') ) ) AND u.memberEntity.id = :userId AND r.id is null order by m.name") org.springframework.data.domain.Page<GroupEntity> getDetachedForUser(@Param("userId") String userId, @Param("name") String name, org.springframework.data.domain.Pageable page)
method is used to detect all user's groups that are not linked with any resources.- Specified by:
getDetachedForUser
in interfaceIDetacheableEntityRepository<GroupEntity,String>
- Parameters:
userId
- - id of User to check detached groupsname
- - name for case INSENSITIVE CONTAINS match search.page
- -Pageable
for paging- Returns:
- -
with results;
-
doesUserLinkedWithGroup
@Query("SELECT count(m) FROM UserToGroupMembershipXrefEntity m join m.entity r join m.memberEntity u WHERE r.id=:groupId and u.id=:userId") int doesUserLinkedWithGroup(@Param("groupId") String groupId, @Param("userId") String userId)
-
numberOfUsersForGroups
@Query("SELECT new CountXrefDBWrapper (g.id, count(distinct u.id), g.maxUserNumber, \'Group\') FROM GroupEntity g left join g.users u WHERE g.id in (:groupIds) group by g.id, g.maxUserNumber") List<CountXrefDBWrapper> numberOfUsersForGroups(@Param("groupIds") Collection<String> groupIds)
-
numberOfUsersForAllGroups
@Query("SELECT new CountXrefDBWrapper (g.id, count(distinct u.id), g.maxUserNumber, \'Group\') FROM GroupEntity g left join g.users u group by g.id, g.maxUserNumber") List<CountXrefDBWrapper> numberOfUsersForAllGroups()
-
collectPolicyIdsByGroupIds
@Query("SELECT g.policy.id FROM GroupEntity g WHERE g.id IN :ids") Set<String> collectPolicyIdsByGroupIds(@Param("ids") Collection<String> ids)
-
-