Repository

interface Repository<Id : EntityId<*>, E : Entity<Id>>

Repository interface for persisting and retrieving entities.

Acts as a collection-like abstraction over entity storage, providing CRUD operations and factory-like creation capabilities.

Type Parameters

Id

the type of entity identifier (must extend EntityId).

E

the type of entity being managed (must extend Entity).

Inheritors

Functions

Link copied to clipboard
abstract fun delete(entity: E)

Deletes an existing entity.

Link copied to clipboard
abstract fun findById(id: Id): E?

Retrieves an entity by its identifier.

Link copied to clipboard
abstract fun save(entity: E)

Persists a new entity.

Link copied to clipboard
abstract fun update(entity: E)

Updates an existing entity.