org.appng.core.repository

## Interface RoleRepository

- All Superinterfaces:
    org.springframework.data.repository.CrudRepository<RoleImpl,Integer>, org.springframework.data.jpa.repository.JpaRepository<RoleImpl,Integer>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<RoleImpl>, org.springframework.data.repository.PagingAndSortingRepository<RoleImpl,Integer>, org.springframework.data.repository.query.QueryByExampleExecutor<RoleImpl>, org.springframework.data.repository.Repository<RoleImpl,Integer>, SearchRepository<RoleImpl,Integer>

      public interface RoleRepository
      extends SearchRepository<RoleImpl,Integer>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<RoleImpl>` | `findByApplicationId(Integer applicationId)`
    `RoleImpl` | `findByApplicationIdAndName(Integer applicationId, String name)`
    `RoleImpl` | `findByApplicationNameAndName(String applicationName, String name)`
    `List<RoleImpl>` | `findRolesForApplicationAndSite(Integer siteId, Integer applicationId)`
    `List<RoleImpl>` | `findRolesForSite(Integer siteId)`

    - ### Methods inherited from interface org.appng.persistence.repository.SearchRepository

      `createSearchQuery, detach, getHistory, getRevision, getRevisionNumber, isUnique, isUnique, search, search, search, search`

    - ### Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

      `deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlush`

    - ### Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

      `findAll`

    - ### Methods inherited from interface org.springframework.data.repository.CrudRepository

      `count, delete, delete, delete, deleteAll, exists, findOne, save`

    - ### Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

      `count, exists, findAll, findOne`

    - ### Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

      `count, findAll, findAll, findAll, findOne`

- - ### Method Detail

    - #### findByApplicationId

          List<RoleImpl> findByApplicationId(Integer applicationId)

    - #### findByApplicationIdAndName

          RoleImpl findByApplicationIdAndName(Integer applicationId,
                                              String name)

    - #### findByApplicationNameAndName

          RoleImpl findByApplicationNameAndName(String applicationName,
                                                String name)

    - #### findRolesForSite

          @Query(value="select r from SiteApplication s inner join s.application p inner join p.roles r where s.id.siteId = ?1 order by p.name, r.name")
          List<RoleImpl> findRolesForSite(Integer siteId)

    - #### findRolesForApplicationAndSite

          @Query(value="select r from SiteApplication s inner join s.application p inner join p.roles r where s.id.siteId = ?1 and s.id.applicationId = ?2 order by p.name, r.name")
          List<RoleImpl> findRolesForApplicationAndSite(Integer siteId,
                                                                                                                                                                                                                                   Integer applicationId)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.