EnumSqlType

class EnumSqlType<C : Enum<C>>(val enumClass: Class<C>) : SqlType<C> (source)

SqlType implementation that saves enums as strings.

Constructors

Link copied to clipboard
constructor(typeRef: TypeReference<C>)
constructor(enumClass: Class<C>)

Properties

Link copied to clipboard

the enum class.

Link copied to clipboard

a constant value defined in java.sql.Types to identify JDBC types.

Link copied to clipboard

the name of the type in specific databases, such as int, bigint, varchar, etc.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this SQL type. Two SQL types are equal if they have the same type codes and names.

Link copied to clipboard
open fun getResult(rs: ResultSet, index: Int): C?

Obtain a result from a given ResultSet by index.

open fun getResult(rs: ResultSet, columnLabel: String): C?

Obtain a result from a given ResultSet by columnLabel.

Link copied to clipboard
open override fun hashCode(): Int

Return a hash code value for this SQL type.

Link copied to clipboard
open override fun setParameter(ps: PreparedStatement, index: Int, parameter: C?)

Set the nullable parameter to a given PreparedStatement.

Link copied to clipboard
open fun <R : Any> transform(fromUnderlyingValue: (C) -> R, toUnderlyingValue: (R) -> C): SqlType<R>

Transform this SqlType to another. The returned SqlType has the same typeCode and typeName as the underlying one, and performs the specific transformations on column values.