Reference

class Reference<ID : Any, Parent : Entity<ID>, REF : Any>(val reference: Column<REF>, val factory: EntityClass<ID, Parent>, val 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. R2DBC counterpart of JDBC's Reference from References.kt; the property delegate yields an Accessor for suspending lookups.

Parameters

reference

The reference column defined on the child entity's associated table.

factory

The EntityClass associated with the parent entity referenced by the child entity.

Constructors

Link copied to clipboard
constructor(reference: Column<REF>, factory: EntityClass<ID, Parent>, references: Map<Column<*>, Column<*>>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val references: Map<Column<*>, Column<*>>?

Composite-FK child→parent column map (mirrors JDBC's Reference.references). null for single-column references — Accessor falls back to reference.referee.

Functions

Link copied to clipboard
operator fun <SRC : Entity<*>> provideDelegate(thisRef: SRC, property: KProperty<*>): Accessor<ID, Parent, REF>

Wires up the property delegate by returning an Accessor bound to the source thisRef entity.