UserRepository

interface UserRepository : KRepository<User, Long>

用户仓储接口

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

Author

lishangbu

Since

2025/08/19

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val entityType: KClass<User>
Link copied to clipboard
abstract val sql: KSqlClient
Link copied to clipboard
abstract val type: ImmutableType

Functions

Link copied to clipboard
abstract fun count(): Long
Link copied to clipboard
open fun delete(entity: User)
abstract fun delete(entity: User, mode: DeleteMode): Int
Link copied to clipboard
abstract fun deleteAll()
open fun deleteAll(entities: Iterable<User>)
abstract fun deleteAll(entities: Iterable<User>, mode: DeleteMode): Int
Link copied to clipboard
@AliasFor(value = "deleteByIds")
open fun deleteAllById(ids: Iterable<Long>)
Link copied to clipboard
open fun deleteById(id: Long)
abstract fun deleteById(id: Long, mode: DeleteMode): Int
Link copied to clipboard
@AliasFor(value = "deleteAllById")
open fun deleteByIds(ids: Iterable<Long>)
abstract fun deleteByIds(ids: Iterable<Long>, mode: DeleteMode): Int
Link copied to clipboard
open fun existsById(id: Long): Boolean
Link copied to clipboard
open fun findAll(specification: Specification<User>?): List<UserView>

按条件查询用户列表

open fun findAll(specification: Specification<User>?, pageable: Pageable): Page<UserView>

按条件分页查询用户

open fun findAll(): List<User>
abstract fun findAll(fetcher: Fetcher<User>?): List<User>
abstract override fun findAll(pageable: Pageable): Page<User>
open override fun findAll(sort: Sort): List<User>
abstract fun findAll(fetcher: Fetcher<User>?, block: SortDsl<User>.() -> Unit): List<User>
abstract fun findAll(fetcher: Fetcher<User>?, sort: Sort): List<User>
abstract fun findAll(pageable: Pageable, fetcher: Fetcher<User>?): Page<User>
abstract fun findAll(pageIndex: Int, pageSize: Int, fetcher: Fetcher<User>?, block: SortDsl<User>.() -> Unit?): Page<User>
abstract fun findAll(pageIndex: Int, pageSize: Int, fetcher: Fetcher<User>?, sort: Sort): Page<User>
Link copied to clipboard
@AliasFor(value = "findByIds")
open fun findAllById(ids: Iterable<Long>): List<User>
Link copied to clipboard
open fun findById(id: Long): Optional<User>
open fun findById(id: Long, fetcher: Fetcher<User>): Optional<User>
Link copied to clipboard
@AliasFor(value = "findAllById")
abstract fun findByIds(ids: Iterable<Long>, fetcher: Fetcher<User>?): List<User>
Link copied to clipboard
abstract fun findMapByIds(ids: Iterable<Long>, fetcher: Fetcher<User>?): Map<Long, User>
Link copied to clipboard
abstract fun findNullable(id: Long, fetcher: Fetcher<User>?): User?
Link copied to clipboard
open fun insert(entity: User, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun insert(input: Input<User>, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
Link copied to clipboard
open fun insertIfAbsent(entity: User, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun insertIfAbsent(input: Input<User>, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
Link copied to clipboard
open fun listViews(specification: Specification<User>?): List<UserView>

按条件查询用户视图列表

Link copied to clipboard
open fun listWithRoles(specification: Specification<User>?): List<UserView>

按条件查询用户列表,并抓取角色

Link copied to clipboard
open fun loadByAccountWithRoles(account: String): User?

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

Link copied to clipboard
open fun loadViewById(id: Long): UserView?

按 ID 查询用户视图

Link copied to clipboard
open fun merge(entity: User, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun merge(input: Input<User>, block: KSaveCommandPartialDsl.() -> Unit?): User
Link copied to clipboard
open fun pageViews(specification: Specification<User>?, pageable: Pageable): Page<UserView>

按条件分页查询用户视图

Link copied to clipboard
open fun pageWithRoles(specification: Specification<User>?, pageable: Pageable): Page<UserView>

按条件分页查询用户,并抓取角色

Link copied to clipboard
open fun <S : User> save(entity: S): S
open fun save(input: Input<User>, block: KSaveCommandDsl.() -> Unit?): User
open fun <V : View<User>> save(entity: User, viewType: KClass<V>, block: KSaveCommandDsl.() -> Unit?): V
open fun save(entity: User, fetcher: Fetcher<User>, block: KSaveCommandDsl.() -> Unit?): User
open fun <V : View<User>> save(input: Input<User>, viewType: KClass<V>, block: KSaveCommandDsl.() -> Unit?): V
open fun save(input: Input<User>, fetcher: Fetcher<User>, block: KSaveCommandDsl.() -> Unit?): User
open fun save(entity: User, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun save(input: Input<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun <V : View<User>> save(entity: User, mode: SaveMode, associatedMode: AssociatedSaveMode, viewType: KClass<V>, block: KSaveCommandPartialDsl.() -> Unit?): V
open fun save(entity: User, mode: SaveMode, associatedMode: AssociatedSaveMode, fetcher: Fetcher<User>, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun <V : View<User>> save(input: Input<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, viewType: KClass<V>, block: KSaveCommandPartialDsl.() -> Unit?): V
open fun save(input: Input<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, fetcher: Fetcher<User>, block: KSaveCommandPartialDsl.() -> Unit?): User
Link copied to clipboard
open fun <S : User> saveAll(entity: Iterable<S>): List<S>
Link copied to clipboard
open fun saveCommand(entity: User, block: KSaveCommandDsl.() -> Unit?): KSimpleEntitySaveCommand<User>
open fun saveCommand(input: Input<User>, block: KSaveCommandDsl.() -> Unit?): KSimpleEntitySaveCommand<User>
open fun saveCommand(entity: User, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): KSimpleEntitySaveCommand<User>
open fun saveCommand(input: Input<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): KSimpleEntitySaveCommand<User>
Link copied to clipboard
open fun saveEntities(entities: Iterable<User>, block: KSaveCommandDsl.() -> Unit?): List<User>
open fun <V : View<User>> saveEntities(entities: Iterable<User>, viewType: KClass<V>, block: KSaveCommandDsl.() -> Unit?): List<V>
open fun saveEntities(entities: Iterable<User>, fetcher: Fetcher<User>, block: KSaveCommandDsl.() -> Unit?): List<User>
open fun saveEntities(entities: Iterable<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): List<User>
open fun <V : View<User>> saveEntities(entities: Iterable<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, viewType: KClass<V>, block: KSaveCommandPartialDsl.() -> Unit?): List<V>
open fun saveEntities(entities: Iterable<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, fetcher: Fetcher<User>, block: KSaveCommandPartialDsl.() -> Unit?): List<User>
Link copied to clipboard
open fun saveEntitiesCommand(entities: Iterable<User>, block: KSaveCommandDsl.() -> Unit?): KBatchEntitySaveCommand<User>
open fun saveEntitiesCommand(entities: Iterable<User>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): KBatchEntitySaveCommand<User>
Link copied to clipboard
open fun saveInputs(inputs: Iterable<Input<User>>, block: KSaveCommandDsl.() -> Unit?): List<User>
open fun <V : View<User>> saveInputs(inputs: Iterable<Input<User>>, viewType: KClass<V>, block: KSaveCommandDsl.() -> Unit?): List<V>
open fun saveInputs(inputs: Iterable<Input<User>>, fetcher: Fetcher<User>, block: KSaveCommandDsl.() -> Unit?): List<User>
open fun saveInputs(inputs: Iterable<Input<User>>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): List<User>
open fun <V : View<User>> saveInputs(inputs: Iterable<Input<User>>, mode: SaveMode, associatedMode: AssociatedSaveMode, viewType: KClass<V>, block: KSaveCommandPartialDsl.() -> Unit?): List<V>
open fun saveInputs(inputs: Iterable<Input<User>>, mode: SaveMode, associatedMode: AssociatedSaveMode, fetcher: Fetcher<User>, block: KSaveCommandPartialDsl.() -> Unit?): List<User>
Link copied to clipboard
open fun saveInputsCommand(input: Iterable<Input<User>>, block: KSaveCommandDsl.() -> Unit?): KBatchEntitySaveCommand<User>
open fun saveInputsCommand(inputs: Iterable<Input<User>>, mode: SaveMode, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): KBatchEntitySaveCommand<User>
Link copied to clipboard
open fun update(entity: User, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
open fun update(input: Input<User>, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit?): User
Link copied to clipboard
abstract fun <V : View<User>> viewer(viewType: KClass<V>): KRepository.Viewer<User, Long, V>