Interface RoleUserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<RoleUser,String>, org.springframework.data.jpa.repository.JpaRepository<RoleUser, String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<RoleUser>, org.springframework.data.repository.ListCrudRepository<RoleUser, String>, org.springframework.data.repository.ListPagingAndSortingRepository<RoleUser, String>, org.springframework.data.repository.PagingAndSortingRepository<RoleUser, String>, org.springframework.data.repository.query.QueryByExampleExecutor<RoleUser>, org.springframework.data.repository.Repository<RoleUser, String>
@Repository
@NullMarked
public interface RoleUserRepository
extends org.springframework.data.jpa.repository.JpaRepository<RoleUser,String>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<RoleUser>
RoleUserRepository 是角色-用户关联的 JPA 数据仓库接口。
它提供了对 RoleUser 实体的数据库操作,包括按角色ID或用户ID查询、检查是否存在、删除以及按角色ID和用户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 TypeMethodDescriptionvoiddeleteByRoleIdAndUserId(String roleId, String userId) 删除指定角色ID和用户ID的角色-用户关联。booleanexistsByRoleIdAndUserId(String roleId, String userId) 检查指定角色ID和用户ID的关联是否存在。findByRoleId(String roleId) 根据角色ID查询所有角色-用户关联。findByRoleIdAndUserId(String roleId, String userId) 根据角色ID和用户ID查询单个角色-用户关联。findByUserId(String userId) 根据用户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
-
findByRoleId
-
existsByRoleIdAndUserId
-
deleteByRoleIdAndUserId
-
findByUserId
-
findByRoleIdAndUserId
-