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 TypeMethodDescriptionvoiddeleteByRoleIdInAndPermission(Collection<String> roleIds, String permission) 删除指定角色ID集合和权限编码的所有角色-权限关联。booleanexistsByRoleIdAndPermission(String roleId, String permission) 检查指定角色ID和权限编码的关联是否存在。findByPermission(String permission) 根据权限编码查询角色-权限关联。findByRoleIdIn(Collection<String> roleIds) 根据角色ID集合查询角色-权限关联。Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, updateMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByRoleIdIn
根据角色ID集合查询角色-权限关联。- Parameters:
roleIds- 角色ID集合。- Returns:
- 匹配的角色-权限关联列表。
-
existsByRoleIdAndPermission
-
deleteByRoleIdInAndPermission
删除指定角色ID集合和权限编码的所有角色-权限关联。- Parameters:
roleIds- 角色ID集合。permission- 权限编码。
-
findByPermission
根据权限编码查询角色-权限关联。- Parameters:
permission- 权限编码。- Returns:
- 匹配的角色-权限关联列表。
-