AuditableRepository

interface AuditableRepository<T : Auditable<*>> : ArrowContextCrudRepository<T> , Component(source)

Represents a repository interface for managing entities that implement the Auditable interface. It provides hooks for handling common auditing fields such as createdAt, createdBy, updatedAt, and updatedBy during insert and update operations. Additionally, it supports tracing and error handling for database operations.

Type Parameters

T

The type of the entity managed by this repository. Must implement the Auditable interface.

Properties

Link copied to clipboard
open val app: Application

Functions

Link copied to clipboard
open suspend fun afterDeleteHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
open suspend fun afterInsertHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
open suspend fun afterUpdateHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
open suspend override fun <R> aroundQuery(method: String, statement: Statement, block: suspend () -> R): R
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun batchInsert(entities: Iterable<T>): DbResult<List<T>>
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun batchUpdate(entities: Iterable<T>): DbResult<List<T>>
Link copied to clipboard
open suspend fun ctx(): ExecContext
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun delete(entity: T): DbResult<Unit>
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun insert(entity: T): DbResult<T>
Link copied to clipboard
open suspend fun preDeleteHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
open suspend override fun preInsertHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
open suspend override fun preUpdateHook(context: QueryExecutor, entity: T): T
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun save(entity: T): DbResult<T>
Link copied to clipboard
context(context: QueryExecutor)
abstract suspend fun update(entity: T): DbResult<T>