VarCharColumnType

open class VarCharColumnType(val colLength: Int = 255, val collate: String? = null) : StringColumnType

Character column for storing strings with the specified maximum colLength using the specified collate type.

Constructors

Link copied to clipboard
constructor(colLength: Int = 255, collate: String? = null)

Properties

Link copied to clipboard
val collate: String? = null

Returns the collate type used in by this column.

Link copied to clipboard
val colLength: Int = 255

Returns the maximum length of this column.

Link copied to clipboard

Returns true if this is an auto-increment column, false otherwise.

Link copied to clipboard
open override var nullable: Boolean

Returns true if the column type is nullable, false otherwise.

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

Returns the String representation of the specified non-null value when value is set as the default for the column.

Link copied to clipboard
open override fun nonNullValueToString(value: String): String

Returns the SQL representation of the specified non-null value, for this column type.

Link copied to clipboard
open fun notNullValueToDB(value: String): Any

Returns an object compatible with the database, from the specified non-null value, for this column type.

Link copied to clipboard
open fun parameterMarker(value: String?): String

Defines the appearance of parameter markers in prepared SQL statements.

Link copied to clipboard
open fun preciseType(): String
Link copied to clipboard
open fun readObject(rs: ResultSet, index: Int): Any?

Returns the object at the specified index in the rs.

Link copied to clipboard
open fun setParameter(stmt: PreparedStatementApi, index: Int, value: Any?)

Sets the value at the specified index into the stmt.

Link copied to clipboard
open override fun sqlType(): String

Returns the SQL type of this column.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validateValueBeforeUpdate(value: String?)

Function checks that provided value is suites the column type and throws IllegalArgumentException otherwise. value can be of any type (including Expression)

Link copied to clipboard

Returns the String representation of the specified value when value is set as the default for the column. If the value is null and the column is not nullable, an exception will be thrown. Used for metadata default value comparison.

Link copied to clipboard
open override fun valueFromDB(value: Any): String

Converts the specified value (from the database) to an object of the appropriated type, for this column type. Default implementation returns the same instance.

Link copied to clipboard
open fun valueToDB(value: String?): Any?

Returns an object compatible with the database, from the specified value, for this column type.

Link copied to clipboard
open fun valueToString(value: String?): String

Returns the SQL representation of the specified value, for this column type. If the value is null and the column is not nullable, an exception will be thrown. Used when generating an SQL statement and when logging that statement.