All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tcds.orm.column.nullable.NullableFloatColumn.kt Maven / Gradle / Ivy

Go to download

Kotlin Simple ORM is a simple but powerful database orm for kotlin applications

There is a newer version: 0.3.14
Show newest version
package io.tcds.orm.column.nullable

import io.tcds.orm.Column
import java.sql.PreparedStatement
import java.sql.Types

class NullableFloatColumn(name: String, value: (Entity) -> Float?) : Column(name, value) {
    override fun columnType(): String = "FLOAT NULL"

    override fun bind(stmt: PreparedStatement, index: Int, value: Float?) {
        when (value) {
            null -> stmt.setNull(index, Types.FLOAT)
            else -> stmt.setFloat(index, value)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy