English | 简体中文

api-docs / org.ktorm.schema / Table / bindTo


inline fun <C : Any> Column<C>.bindTo(
    selector: (E) -> C?
): Column<C>
(source code)

Bind the column to nested properties, eg. employee.manager.department.id.

Note: Since Column is immutable, this function will create a new Column instance and replace the origin
registered one.


selector - a lambda in which we should return the property we want to bind.
For example: val name = varchar("name").bindTo { it.name }.

the new Column instance.