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 Type
    Method
    Description
    void
     
    boolean
     
     
    Groups the given user directly manages (manager or * membership, non inherited) that are also designated as an Organizational Unit, joined directly against SOC_USER_PERMISSION by group id.
    boolean
    Whether at least one of the given groups is designated as an Organizational Unit that the given user directly manages (manager or * membership, non inherited).
    boolean
    isManagedByUserName(String groupId, String userName)
    Whether the given group is designated as an Organizational Unit that the given user directly manages (manager or * membership, non inherited).

    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

    • findByGroupId

      Optional<OrganizationalUnitEntity> findByGroupId(String groupId)
    • existsByGroupId

      boolean existsByGroupId(String groupId)
    • deleteByGroupId

      void deleteByGroupId(String groupId)
    • 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 (manager or * membership, non inherited) that are also designated as an Organizational Unit, joined directly against SOC_USER_PERMISSION by 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 (manager or * 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 (manager or * 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.