get

inline operator fun <T> get(index: Int): T

Returns the attribute at index, cast to T.

Also written composite[0], where the expected type is what fixes T - val id: Int = composite[0]. The counterpart of set.

Return

The attribute value.

Parameters

index

Zero-based index in declaration order.

Type Parameters

T

The expected attribute type. Declare it nullable to accept a SQL NULL.

Throws

COLUMN_NOT_FOUND if index is outside this composite's attributes, CONVERSION_ERROR if the value is null under a non-nullable T, or is not a T.


inline operator fun <T> get(name: String): T

Returns the attribute named name, cast to T.

Also written composite["cognomen"], where the expected type is what fixes T - and its nullability with it, as on Row: val name: String = composite["cognomen"] refuses a NULL. The counterpart of set.

Return

The attribute value.

Parameters

name

The attribute name, as declared in the database.

Type Parameters

T

The expected attribute type. Declare it nullable to accept a SQL NULL.

Throws

COLUMN_NOT_FOUND if there is no such attribute, CONVERSION_ERROR if the value is null under a non-nullable T, or is not a T.