io.tcds.orm.column.nullable.NullableIntegerColumn.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of orm Show documentation
Show all versions of orm Show documentation
Kotlin Simple ORM is a simple but powerful database orm for kotlin applications
package io.tcds.orm.column.nullable
import io.tcds.orm.Column
import java.sql.PreparedStatement
import java.sql.Types
class NullableIntegerColumn(name: String, value: (Entity) -> Int?) : Column(name, value) {
override fun columnType(): String = "INTEGER NULL"
override fun bind(stmt: PreparedStatement, index: Int, value: Int?) {
when (value) {
null -> stmt.setNull(index, Types.INTEGER)
else -> stmt.setInt(index, value)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy