Referrers
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.
class Director(id: EntityID<Int>) : IntEntity(id) {
val films by Film referrersOn Films.director
companion object : IntEntityClass<Director>(Directors)
}
val titles = director.films.map { it.title }Content copied to clipboard
The property is read-only — a child joins the relation by having its own reference set.
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.
cache
Whether loaded reference entities should be stored in the EntityCache.
Constructors
Properties
Functions
Link copied to clipboard
infix fun orderBy(order: Pair<Expression<*>, SortOrder>): Referrers<ParentID, Parent, ChildID, Child, REF>
Modifies this reference to sort entities according to the specified order.
infix fun orderBy(order: List<Pair<Expression<*>, SortOrder>>): Referrers<ParentID, Parent, ChildID, Child, REF>
fun orderBy(vararg order: Pair<Expression<*>, SortOrder>): Referrers<ParentID, Parent, ChildID, Child, REF>
Modifies this reference to sort entities based on multiple columns as specified in order.
Modifies this reference to sort entities by a column specified in expression using ascending order.