[jOOQ/jOOQ#6347] Add TableLike.get(X) kotlin operators as aliases for Table.field(X)

This commit is contained in:
Lukas Eder 2020-11-27 17:15:05 +01:00
parent f5b2ff20a0
commit 222d2b4961

View File

@ -79,6 +79,22 @@ inline fun Field<Boolean>.orNotExists(select: Select<*>): Condition = condition(
inline fun Field<Boolean>.not(): Condition = condition(this).not()
// ----------------------------------------------------------------------------
// Extensions to extract fields from Tables
// ----------------------------------------------------------------------------
@Support
inline operator fun TableLike<*>.get(index: Int) = this.field(index)
@Support
inline operator fun TableLike<*>.get(name: Name) = this.field(name)
@Support
inline operator fun TableLike<*>.get(name: String) = this.field(name)
@Support
inline operator fun <T> TableLike<*>.get(field: Field<T>) = this.field(field)
// ----------------------------------------------------------------------------
// Extensions to make Field<T[]> aware of its being an array
// ----------------------------------------------------------------------------