UserRepository

interface UserRepository

用户仓储接口

定义用户数据的查询与持久化操作

Author

lishangbu

Since

2025/08/19

Inheritors

Functions

Link copied to clipboard
abstract fun deleteById(id: Long)

按 ID 删除用户

Link copied to clipboard
abstract fun findAll(example: Example<User>?): List<User>

按条件查询用户列表

abstract fun findAll(example: Example<User>?, pageable: Pageable): Page<User>

按条件分页查询用户

Link copied to clipboard
abstract fun findById(id: Long): User?

按 ID 查询用户

Link copied to clipboard
abstract fun findUserWithRolesByAccount(account: String): User?

根据账号查找用户及角色列表

Link copied to clipboard
abstract fun flush()

刷新持久化上下文

Link copied to clipboard
abstract fun save(user: User): User

保存用户

Link copied to clipboard
abstract fun saveAndFlush(user: User): User

保存用户并立即刷新