JsonBColumnType

class JsonBColumnType<T : Any>(serialize: (T) -> String, deserialize: (String) -> T) : JsonColumnType<T>

Column for storing JSON data in binary format.

Parameters

serialize

Function that encodes an object of type T to a JSON String

deserialize

Function that decodes a JSON String to an object of type T

Samples

jsonb

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 = true

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