Table

class Table<T : Any>(val primaryKey: KProperty1<T, *>, foreignKeys: List<Pair<KProperty1<T, *>, KClass<*>>> = listOf(), constraints: List<Pair<KProperty1<T, *>, List<C>>> = listOf(), val serializers: List<TypeSerializer<*>> = listOf(), columnSerializers: List<Pair<KProperty1<T, *>, TypeSerializer<*>>> = listOf())

A class representing a table in a database or schema. This class is intermediate structure created by the user which is then converted by the Mapper to more appropriate TableInfo structure.

Parameters

T

the type that represents database table.

Constructors

Link copied to clipboard
constructor(primaryKey: KProperty1<T, *>, foreignKeys: List<Pair<KProperty1<T, *>, KClass<*>>> = listOf(), constraints: List<Pair<KProperty1<T, *>, List<C>>> = listOf(), serializers: List<TypeSerializer<*>> = listOf(), columnSerializers: List<Pair<KProperty1<T, *>, TypeSerializer<*>>> = listOf())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Represents a map of column serializers. This serializer have the highest priority over all other serializers defined inside database serializer.

Link copied to clipboard
internal val constraints: Map<KProperty1<T, *>, List<C>>

Map of Table column constraints.

Link copied to clipboard

Map of Table foreign keys that points to specific foreign class.

Link copied to clipboard
val kclass: KClass<*>

Kotlin class that represents this Table.

Link copied to clipboard

Unescaped name of the Table.

Link copied to clipboard

the primary key of the table.

Link copied to clipboard
internal val serializers: List<TypeSerializer<*>>

the serializers which will overrides global and schema serializer that will help serialize table columns (optional).