Interface RolePermissionRepository

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

@Repository @NullMarked public interface RolePermissionRepository extends org.springframework.data.jpa.repository.JpaRepository<RolePermission, String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<RolePermission>

RolePermissionRepository 是角色-权限关联的 JPA 数据仓库接口。

它提供了对 RolePermission 实体的数据库操作,包括按角色ID查询、检查是否存在、删除以及按权限查询。

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    删除指定角色ID集合和权限编码的所有角色-权限关联。
    boolean
    检查指定角色ID和权限编码的关联是否存在。
    根据权限编码查询角色-权限关联。
    根据角色ID集合查询角色-权限关联。

    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.jpa.repository.JpaSpecificationExecutor

    count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, update

    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

    • findByRoleIdIn

      List<RolePermission> findByRoleIdIn(Collection<String> roleIds)
      根据角色ID集合查询角色-权限关联。
      Parameters:
      roleIds - 角色ID集合。
      Returns:
      匹配的角色-权限关联列表。
    • existsByRoleIdAndPermission

      boolean existsByRoleIdAndPermission(String roleId, String permission)
      检查指定角色ID和权限编码的关联是否存在。
      Parameters:
      roleId - 角色ID。
      permission - 权限编码。
      Returns:
      如果存在则为 true,否则为 false
    • deleteByRoleIdInAndPermission

      void deleteByRoleIdInAndPermission(Collection<String> roleIds, String permission)
      删除指定角色ID集合和权限编码的所有角色-权限关联。
      Parameters:
      roleIds - 角色ID集合。
      permission - 权限编码。
    • findByPermission

      List<RolePermission> findByPermission(String permission)
      根据权限编码查询角色-权限关联。
      Parameters:
      permission - 权限编码。
      Returns:
      匹配的角色-权限关联列表。