optionalBackReferencedOn
infix fun <TargetID : Any, Target : Entity<TargetID>, REF : Any> EntityClass<TargetID, Target>.optionalBackReferencedOn(column: Column<REF>): OptionalBackReference<TargetID, Target, ID, Entity<ID>, REF>
infix fun <TargetID : Any, Target : Entity<TargetID>, REF : Any> EntityClass<TargetID, Target>.optionalBackReferencedOn(column: Column<REF?>): OptionalBackReference<TargetID, Target, ID, Entity<ID>, REF>
Registers an optional reference as an immutable field of the parent entity class, which returns a child object of this EntityClass
.
The reference should have been defined by the creation of a column using either optReference()
or reference().nullable()
on the child table.
Samples
org.jetbrains.exposed.sql.tests.shared.entities.EntityTests.Studentorg.jetbrains.exposed.sql.tests.shared.entities.EntityTests.StudentBiosorg.jetbrains.exposed.sql.tests.shared.entities.EntityTests.StudentBioinfix fun <TargetID : Any, Target : Entity<TargetID>> EntityClass<TargetID, Target>.optionalBackReferencedOn(table: IdTable<*>): OptionalBackReference<TargetID, Target, ID, Entity<ID>, Any>
Registers an optional reference as an immutable field of the parent entity class, which returns a child object of this EntityClass
.
The reference should have been defined by the creation of a foreign key constraint on the child table, by using foreignKey()
.