override fun setValue()

in dnq/src/main/kotlin/kotlinx/dnq/link/XdManyToOneOptionalLink.kt [53:66]


    override fun setValue(thisRef: R, property: KProperty<*>, value: T?) {
        val session = thisRef.threadSessionOrThrow
        if (value != null) {
            thisRef.reattach(session).setManyToOne(property.dbName, oppositeField.oppositeDbName, value.reattach(session))
        } else {
            getValue(thisRef, property)
                    ?.reattach(session)
                    ?.removeOneToMany(
                            property.dbName,
                            oppositeField.oppositeDbName,
                            thisRef.reattach(session)
                    )
        }
    }