JsonColumnType

open class JsonColumnType<T : Any>(val serialize: (T) -> String, val deserialize: (String) -> T) : ColumnType<T> , JsonColumnMarker

Column for storing JSON data, either in non-binary text format or the vendor's default JSON type format.

Samples

json

Inheritors

Constructors

Link copied to clipboard
constructor(serialize: (T) -> String, deserialize: (String) -> T)

Properties

Link copied to clipboard
val deserialize: (String) -> T

Decode a JSON String to an object of type T.

Link copied to clipboard
open override var nullable: Boolean
Link copied to clipboard
val serialize: (T) -> String

Encode an object of type T to a JSON String.

Link copied to clipboard
open override val usesBinaryFormat: Boolean = false

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun nonNullValueAsDefaultString(value: T): String
Link copied to clipboard
open override fun nonNullValueToString(value: T): String
Link copied to clipboard
open override fun notNullValueToDB(value: T): Any
Link copied to clipboard
open override fun parameterMarker(value: T?): String
Link copied to clipboard
open fun readObject(rs: ResultSet, index: Int): Any?
Link copied to clipboard
open override fun setParameter(stmt: PreparedStatementApi, index: Int, value: Any?)
Link copied to clipboard
open override fun sqlType(): String
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun validateValueBeforeUpdate(value: T?)
Link copied to clipboard
open fun valueAsDefaultString(value: T?): String
Link copied to clipboard
open override fun valueFromDB(value: Any): T
Link copied to clipboard
open fun valueToDB(value: T?): Any?
Link copied to clipboard
open override fun valueToString(value: T?): String