Interface ClientRoleRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ClientRole,String>, org.springframework.data.jpa.repository.JpaRepository<ClientRole,String>, org.springframework.data.repository.ListCrudRepository<ClientRole,String>, org.springframework.data.repository.ListPagingAndSortingRepository<ClientRole,String>, org.springframework.data.repository.PagingAndSortingRepository<ClientRole,String>, org.springframework.data.repository.query.QueryByExampleExecutor<ClientRole>, org.springframework.data.repository.Repository<ClientRole,String>

public interface ClientRoleRepository extends org.springframework.data.jpa.repository.JpaRepository<ClientRole,String>
Repository class to represent the data access layer of the `client_role` entity.
Author:
Infosys Equinox
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    ClientRolePrivilegeProjection interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    findAll(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification)
     
    findAll(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification, org.springframework.data.domain.Sort sort)
     
    This method return roles of client in all business.
    This method return roles of client in the business.
    findAllByClientIdAndCollectionId(String clientId, Long collectionId)
     
     

    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

    • findAllByClientIdAndCollectionId

      List<ClientRole> findAllByClientIdAndCollectionId(String clientId, Long collectionId)
    • findAll

      List<ClientRole> findAll(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification)
    • findAll

      List<ClientRole> findAll(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification, org.springframework.data.domain.Sort sort)
    • findAllByClientIdAndBusinessId

      List<ClientRole> findAllByClientIdAndBusinessId(String clientId, Long businessId)
      This method return roles of client in the business.
      Parameters:
      clientId - a String object.
      businessId - a Long object.
      Returns:
      a List of ClientRole objects.
    • findAllByClientId

      List<ClientRole> findAllByClientId(String clientId)
      This method return roles of client in all business.
      Parameters:
      clientId - a String object.
      Returns:
      a List of ClientRole objects.
    • findAllClientRolesAndPrivilegesByClientIdAndCollectionId

      @Query(value="select p.id as clientprivilegeid, p.entity as cliententity, p.service as clientprivilegeservice, p.action as clientaction, c_role.collection_id as clientcollectionid , r.type as clientroletype , c_role.business_id as clientbusinessid, c_role.service_collection_id as clientservicecollectionid, c_role.service as clientroleservice, c_role.attributes as clientattribute, c_role.role_name as clientrolename, c_role.client_id as clientId, c_role.account_id as clientaccountId from ( ( client_role c_role LEFT JOIN role r on ( (c_role.business_id = r.business_id or r.business_id = 0) and (c_role.collection_id = r.collectionId or r.collectionId = 0) and c_role.role_name = r.name ) ) LEFT JOIN ( role_privilege r_p INNER JOIN privilege p ) on ( r_p.role_id = r.id and r_p.privilege_id = p.id ) ) where ( c_role.client_id = :clientId and c_role.collection_id = :collectionId )", nativeQuery=true) List<ClientRoleRepository.ClientRolePrivilegeProjection> findAllClientRolesAndPrivilegesByClientIdAndCollectionId(@Param("clientId") String clientId, @Param("collectionId") Long collectionId)