BackReference
class BackReference<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)
What a one-to-one relationship declared with backReferencedOn gives back: the single child entity that references this one, read by invoking the property.
class Film(id: EntityID<Int>) : IntEntity(id) {
val review by Review backReferencedOn Reviews.film
companion object : IntEntityClass<Film>(Films)
}
val stars = film.review().starsContent copied to clipboard
The property is invoked rather than read directly because the lookup suspends.
Parameters
reference
The reference column defined on the child entity's associated table.
factory
The EntityClass associated with the child entity that references the parent entity.