InMemoryRepository

open class InMemoryRepository<Id : EntityId<*>, E : Entity<Id>>(repo: MutableMap<Id, E> = mutableMapOf()) : Repository<Id, E>

Constructors

Link copied to clipboard
constructor(repo: MutableMap<Id, E> = mutableMapOf())

Functions

Link copied to clipboard
open override fun delete(entity: E)

Deletes an existing entity.

Link copied to clipboard
fun findAllByPredicate(predicate: (E) -> Boolean): List<E>
Link copied to clipboard
open override fun findById(id: Id): E?

Retrieves an entity by its identifier.

Link copied to clipboard
fun findByPredicate(predicate: (E) -> Boolean): E?
Link copied to clipboard
open override fun save(entity: E)

Persists a new entity.

Link copied to clipboard
open override fun update(entity: E)

Updates an existing entity.