Interface OrganizationalUnitDAO
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<OrganizationalUnitEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<OrganizationalUnitEntity,,Long> org.springframework.data.repository.ListCrudRepository<OrganizationalUnitEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<OrganizationalUnitEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<OrganizationalUnitEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<OrganizationalUnitEntity>,org.springframework.data.repository.Repository<OrganizationalUnitEntity,Long>
@Repository
public interface OrganizationalUnitDAO
extends org.springframework.data.jpa.repository.JpaRepository<OrganizationalUnitEntity,Long>
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByGroupId(String groupId) booleanexistsByGroupId(String groupId) findByGroupId(String groupId) findManagedByUserName(String userName) Groups the given user directly manages (manageror*membership, non inherited) that are also designated as an Organizational Unit, joined directly againstSOC_USER_PERMISSIONby group id.booleanisAnyManagedByUserName(Collection<String> groupIds, String userName) Whether at least one of the given groups is designated as an Organizational Unit that the given user directly manages (manageror*membership, non inherited).booleanisManagedByUserName(String groupId, String userName) Whether the given group is designated as an Organizational Unit that the given user directly manages (manageror*membership, non inherited).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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods 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
-
findByGroupId
-
existsByGroupId
-
deleteByGroupId
-
findManagedByUserName
@Query("SELECT ou FROM SocOrganizationalUnit ou, SocUserPermission up WHERE up.groupId = ou.groupId AND up.userName = :userName AND up.membershipType IN (\'manager\', \'*\') AND up.inherited = false") List<OrganizationalUnitEntity> findManagedByUserName(@Param("userName") String userName) Groups the given user directly manages (manageror*membership, non inherited) that are also designated as an Organizational Unit, joined directly againstSOC_USER_PERMISSIONby group id. -
isManagedByUserName
@Query("SELECT COUNT(ou) > 0 FROM SocOrganizationalUnit ou, SocUserPermission up WHERE ou.groupId = :groupId AND up.groupId = ou.groupId AND up.userName = :userName AND up.membershipType IN (\'manager\', \'*\') AND up.inherited = false") boolean isManagedByUserName(@Param("groupId") String groupId, @Param("userName") String userName) Whether the given group is designated as an Organizational Unit that the given user directly manages (manageror*membership, non inherited). -
isAnyManagedByUserName
@Query("SELECT COUNT(ou) > 0 FROM SocOrganizationalUnit ou, SocUserPermission up WHERE ou.groupId IN (:groupIds) AND up.groupId = ou.groupId AND up.userName = :userName AND up.membershipType IN (\'manager\', \'*\') AND up.inherited = false") boolean isAnyManagedByUserName(@Param("groupIds") Collection<String> groupIds, @Param("userName") String userName) Whether at least one of the given groups is designated as an Organizational Unit that the given user directly manages (manageror*membership, non inherited). The candidates being a group and its enclosing groups, the list is bounded by the nesting depth: a single indexed IN lookup.
-