Package-level declarations

Types

Link copied to clipboard

Base class for an Entity instance identified by an id comprised of multiple wrapped values.

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 representing the EntityClass that manages CompositeEntity instances and maintains their relation to the provided table.

Link copied to clipboard
class DaoEntityID<T : Comparable<T>>(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 : Comparable<ID>>(val id: EntityID<ID>)

Class representing a mapping to values stored in a table record in a database.

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 : Comparable<ID>, out T : Entity<ID>>(val table: IdTable<ID>, entityType: Class<T>? = null, entityCtor: (EntityID<ID>) -> T? = null)

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

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 : Comparable<ID>, 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 : Comparable<ID>, 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 : Comparable<SID>, Source : Entity<SID>, ID : Comparable<ID>, 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>>

Class responsible for implementing property delegates of the read-write properties involved in a many-to-many relation, which uses an intermediate (join) table.

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

Base class for an Entity instance identified by an id comprised of a wrapped Int value.

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 representing the EntityClass that manages IntEntity instances and maintains their relation to the provided table.

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

Base class for an Entity instance identified by an id comprised of a wrapped Long value.

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 representing the EntityClass that manages LongEntity instances and maintains their relation to the provided table.

Link copied to clipboard

Class responsible for implementing property delegates of the read-only properties involved in an optional table relation between two Entity classes, which retrieves the child entity that optionally references the parent entity.

Link copied to clipboard
class OptionalReference<REF : Comparable<REF>, ID : Comparable<ID>, 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 responsible for implementing property delegates of the read-only properties involved in an optional one-to-many relation, which retrieves all child entities that optionally reference the parent entity.

Link copied to clipboard
class Reference<REF : Comparable<REF>, ID : Comparable<ID>, 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 : Comparable<ParentID>, in Parent : Entity<ParentID>, ChildID : Comparable<ChildID>, 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>>

Class responsible for implementing property delegates of the read-only properties involved in a one-to-many relation, which retrieves all child entities that reference the parent entity.

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

Base class for an Entity instance identified by an id comprised of a wrapped UInt value.

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 representing the EntityClass that manages UIntEntity instances and maintains their relation to the provided table.

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

Base class for an Entity instance identified by an id comprised of a wrapped ULong value.

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 representing the EntityClass that manages ULongEntity instances and maintains their relation to the provided table.

Link copied to clipboard
abstract class UUIDEntity(id: EntityID<UUID>) : Entity<UUID>

Base class for an Entity instance identified by an id comprised of a wrapped UUID value.

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 representing the EntityClass that manages UUIDEntity instances and maintains their relation to the provided 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 : Comparable<SRCID>, 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.

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 : Comparable<SRCID>, 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.