OptionalAccessor
class OptionalAccessor<ID : Any, Parent : Entity<ID>, REF : Any>(reference: Column<REF?>, factory: EntityClass<ID, Parent>, entity: Entity<*>, references: Map<Column<*>, Column<*>>? = null)
What a nullable many-to-one reference declared with optionalReferencedOn gives back. Same val + invoke()/set shape as Accessor, except that both ends accept null:
class Film(id: EntityID<Int>) : IntEntity(id) {
val producer by Producer optionalReferencedOn Films.producer
companion object : IntEntityClass<Film>(Films)
}
val name = film.producer()?.name
film.producer.set(null) // clears the referenceContent copied to clipboard