Package-level declarations

Types

Link copied to clipboard

Base class for an Entity with an id made of several columns (CompositeID), mapping a table declared as a CompositeIdTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class CompositeEntityClass<out E : CompositeEntity>(table: IdTable<CompositeID>, entityType: Class<E>? = null, entityCtor: (EntityID<CompositeID>) -> E? = null) : EntityClass<CompositeID, E>

Base class for the companion object of a CompositeEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
class DaoEntityID<T : Any>(id: T?, table: IdTable<T>) : EntityID<T>

Class representing a wrapper for a stored identity value of type T, which is managed and cached by an EntityClass using a data access object pattern.

Link copied to clipboard

Class representing a producer of EntityID instances, which are managed and cached by their respective EntityClass instances using a data access object pattern.

Link copied to clipboard
open class Entity<ID : Any>(val id: EntityID<ID>)

A row of EntityClass.table, with the columns it should expose declared as delegated properties.

Link copied to clipboard
class EntityBatchUpdate(klass: EntityClass<*, Entity<*>>)

Class responsible for performing a batch update operation on multiple instances of an Entity class.

Link copied to clipboard
class EntityCache(transaction: Transaction)

Class responsible for the storage of Entity instances in a specific transaction.

Link copied to clipboard
data class EntityChange(val entityClass: EntityClass<*, Entity<*>>, val entityId: EntityID<*>, val changeType: EntityChangeType, val transactionId: String)

Stores details about a state-change event for an Entity instance.

Link copied to clipboard

Represents the possible states of an Entity throughout its lifecycle.

Link copied to clipboard
abstract class EntityClass<ID : Any, out T : Entity<ID>>(val table: IdTable<ID>, entityType: Class<T>? = null, entityCtor: (EntityID<ID>) -> T? = null)

The entry point for the entities of one table: creating, finding, and deleting them.

Link copied to clipboard

Class responsible for enabling Entity field transformations, which may be useful when advanced database type conversions are necessary for entity mappings.

Link copied to clipboard
object EntityHook

Class responsible for providing functions that expose EntityChange state logic and entity lifecycle features for alerting triggers or customizing additional functionality.

Link copied to clipboard

Represents a StatementInterceptor specifically responsible for the statement lifecycle of Entity instances, which is loaded whenever a Transaction instance is initialized.

Link copied to clipboard
abstract class ImmutableCachedEntityClass<ID : Any, out T : Entity<ID>>(table: IdTable<ID>, entityType: Class<T>? = null, ctor: (EntityID<ID>) -> T? = null) : ImmutableEntityClass<ID, T>

Base class responsible for the management of immutable Entity instances and the maintenance of their relation to the provided table. An internal cache is used to store entity loading states by the associated database, in order to guarantee that that entity updates are synchronized with this class as the lock object.

Link copied to clipboard
abstract class ImmutableEntityClass<ID : Any, out T : Entity<ID>>(table: IdTable<ID>, entityType: Class<T>? = null, ctor: (EntityID<ID>) -> T? = null) : EntityClass<ID, T>

Base class responsible for the management of immutable Entity instances and the maintenance of their relation to the provided table.

Link copied to clipboard
class InnerTableLink<SID : Any, Source : Entity<SID>, ID : Any, Target : Entity<ID>>(val table: Table, sourceTable: IdTable<SID>, val target: EntityClass<ID, Target>, _sourceColumn: Column<EntityID<SID>>? = null, _targetColumn: Column<EntityID<ID>>? = null) : ReadWriteProperty<Source, SizedIterable<Target>>

What a many-to-many relationship declared with via gives back: the entities linked to this one through an intermediate table.

Link copied to clipboard
abstract class IntEntity(id: EntityID<Int>) : Entity<Int>

Base class for an Entity with an Int id, mapping a table declared as an IntIdTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class IntEntityClass<out E : IntEntity>(table: IdTable<Int>, entityType: Class<E>? = null, entityCtor: (EntityID<Int>) -> E? = null) : EntityClass<Int, E>

Base class for the companion object of an IntEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
abstract class LongEntity(id: EntityID<Long>) : Entity<Long>

Base class for an Entity with a Long id, mapping a table declared as a LongIdTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class LongEntityClass<out E : LongEntity>(table: IdTable<Long>, entityType: Class<E>? = null, entityCtor: (EntityID<Long>) -> E? = null) : EntityClass<Long, E>

Base class for the companion object of a LongEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
class OptionalBackReference<ParentID : Any, out Parent : Entity<ParentID>, ChildID : Any, in Child : Entity<ChildID>, REF>(reference: Column<REF?>, factory: EntityClass<ParentID, Parent>, references: Map<Column<*>, Column<*>>? = null) : ReadOnlyProperty<Child, Parent?>

What a one-to-one relationship declared with optionalBackReferencedOn gives back: the single child entity that references this one, or null if there is none.

Link copied to clipboard
class OptionalReference<REF : Any, ID : Any, out Target : Entity<ID>>(val reference: Column<REF?>, val factory: EntityClass<ID, Target>, references: Map<Column<*>, Column<*>>? = null)

Class representing an optional table relation between two Entity classes, which is responsible for retrieving the parent entity optionally referenced by the child entity.

Link copied to clipboard
class Reference<REF : Any, ID : Any, out Target : Entity<ID>>(val reference: Column<REF>, val factory: EntityClass<ID, Target>, references: Map<Column<*>, Column<*>>? = null)

Class representing a table relation between two Entity classes, which is responsible for retrieving the parent entity referenced by the child entity.

Link copied to clipboard
open class Referrers<ParentID : Any, in Parent : Entity<ParentID>, ChildID : Any, out Child : Entity<ChildID>, REF>(val reference: Column<REF>, val factory: EntityClass<ChildID, Child>, val cache: Boolean, references: Map<Column<*>, Column<*>>? = null) : ReadOnlyProperty<Parent, SizedIterable<Child>>

What a one-to-many relationship declared with referrersOn gives back: every child entity whose reference column points at this one.

Link copied to clipboard
abstract class UIntEntity(id: EntityID<UInt>) : Entity<UInt>

Base class for an Entity with a UInt id, mapping a table declared as a UIntIdTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class UIntEntityClass<out E : UIntEntity>(table: IdTable<UInt>, entityType: Class<E>? = null, entityCtor: (EntityID<UInt>) -> E? = null) : EntityClass<UInt, E>

Base class for the companion object of a UIntEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
abstract class ULongEntity(id: EntityID<ULong>) : Entity<ULong>

Base class for an Entity with a ULong id, mapping a table declared as a ULongIdTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class ULongEntityClass<out E : ULongEntity>(table: IdTable<ULong>, entityType: Class<E>? = null, entityCtor: (EntityID<ULong>) -> E? = null) : EntityClass<ULong, E>

Base class for the companion object of a ULongEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
abstract class UuidEntity(id: EntityID<Uuid>) : Entity<Uuid>

Base class for an Entity with a client-generated kotlin.uuid.Uuid id, mapping a table declared as a UuidTable. See Entity for how the entity and its properties are declared.

Link copied to clipboard
abstract class UuidEntityClass<out E : UuidEntity>(table: IdTable<Uuid>, entityType: Class<E>? = null, entityCtor: (EntityID<Uuid>) -> E? = null) : EntityClass<Uuid, E>

Base class for the companion object of a UuidEntity: the entry point for creating, finding, and deleting the rows of table.

Link copied to clipboard
class View<out Target : Entity<*>>(val op: Op<Boolean>, val factory: EntityClass<*, Target>) : SizedIterable<Target>

A SizedIterable of Entity instances that represent a subset of all managed entities that conform to the provided op conditional expression.

Properties

Link copied to clipboard

The current EntityCache for this scope, or a new instance if none exists.

Functions

Link copied to clipboard

Triggers alerts for all unprocessed entity events using any state-change actions previously registered via EntityHook.subscribe.

Link copied to clipboard

Sends all pending Entity inserts and updates stored in this transaction's EntityCache to the database.

Link copied to clipboard
fun <SRCID : Any, SRC : Entity<SRCID>> SRC.load(vararg relations: KProperty1<out Entity<*>, Any?>): SRC

Eager loads references for this Entity instance and returns this entity instance.

Link copied to clipboard
fun Transaction.registerChange(entityClass: EntityClass<*, Entity<*>>, entityId: EntityID<*>, changeType: EntityChangeType)

Creates a new EntityChange with this id and registers it as an entity event.

Link copied to clipboard

Returns a list of all EntityChange events that have been registered in this Transaction.

Link copied to clipboard

Returns the actual Entity instance associated with this event, or null if the entity is not found.

fun <ID : Any, T : Entity<ID>> EntityChange.toEntity(klass: EntityClass<ID, T>): T?

Returns the actual Entity instance associated with this event, or null if either its EntityClass type is neither equivalent to nor a subclass of klass, or if the entity is not found.

Link copied to clipboard
fun <SRCID : Any, SRC : Entity<SRCID>, REF : Entity<*>, L : Iterable<SRC>> L.with(vararg relations: KProperty1<out REF, Any?>): L

Eager loads references for all Entity instances in this collection and returns this collection.

Link copied to clipboard
fun <T> withHook(action: (EntityChange) -> Unit, body: () -> T): T

Calls the specified function body with the given state-change action, registers the action, and returns its result.