Package com.skava.auth.repository
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 ClassesModifier and TypeInterfaceDescriptionstatic interface
ClientRolePrivilegeProjection interface. -
Method Summary
Modifier and TypeMethodDescriptionfindAll
(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification) findAll
(org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification, org.springframework.data.domain.Sort sort) findAllByClientId
(String clientId) This method return roles of client in all business.findAllByClientIdAndBusinessId
(String clientId, Long businessId) This method return roles of client in the business.findAllByClientIdAndCollectionId
(String clientId, Long collectionId) findAllClientRolesAndPrivilegesByClientIdAndCollectionId
(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
-
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
This method return roles of client in the business.- Parameters:
clientId
- aString
object.businessId
- aLong
object.- Returns:
- a
List
ofClientRole
objects.
-
findAllByClientId
This method return roles of client in all business.- Parameters:
clientId
- aString
object.- Returns:
- a
List
ofClientRole
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)
-