Interface RoleRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Role,String>, org.springframework.data.jpa.repository.JpaRepository<Role, String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Role>, org.springframework.data.repository.ListCrudRepository<Role, String>, org.springframework.data.repository.ListPagingAndSortingRepository<Role, String>, org.springframework.data.repository.PagingAndSortingRepository<Role, String>, org.springframework.data.repository.query.QueryByExampleExecutor<Role>, org.springframework.data.repository.Repository<Role, String>
@Repository
@NullMarked
public interface RoleRepository
extends org.springframework.data.jpa.repository.JpaRepository<Role,String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Role>
角色数据访问层接口
对 角色 进行数据库操作的 JPA 接口。
继承 JpaRepository 和 JpaSpecificationExecutor,
提供基础的CRUD操作和动态查询能力。
同时支持角色树形结构相关的查询操作。
- Author:
- xezzon
-
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 TypeMethodDescriptionfindByParentIdIn(Collection<String> parentIds) 根据父角色ID集合查询子角色findByValue(String value) 根据角色编码查询角色findByValueIn(Collection<String> values) 根据角色编码集合批量查询角色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
-
findByValue
-
findByParentIdIn
根据父角色ID集合查询子角色- Parameters:
parentIds- 父角色ID集合- Returns:
- 匹配的子角色列表
-
findByValueIn
根据角色编码集合批量查询角色- Parameters:
values- 角色编码集合- Returns:
- 角色列表,按照传入的编码顺序返回
-