com.dbobjekts.metadata.column.ByteArrayColumns.kt Maven / Gradle / Ivy
package com.dbobjekts.metadata.column
import com.dbobjekts.api.AnyTable
import java.sql.PreparedStatement
import java.sql.ResultSet
import java.sql.Types
class ByteArrayColumn(table: AnyTable, name: String, aggregateType: AggregateType?) :
NonNullableColumn(table,name, ByteArray::class.java, aggregateType) {
constructor(table: AnyTable, name: String) : this(table, name, null)
override fun getValue(position: Int, resultSet: ResultSet): ByteArray? = resultSet.getBytes(position)
override fun setValue(position: Int, statement: PreparedStatement, value: ByteArray) =
statement.setBytes(position, value)
}
class NullableByteArrayColumn(table: AnyTable, name: String, aggregateType: AggregateType?) :
NullableColumn(table,name, Types.BINARY, ByteArray::class.java, aggregateType) {
constructor(table: AnyTable, name: String) : this(table, name, null)
override fun getValue(position: Int, resultSet: ResultSet): ByteArray? = resultSet.getBytes(position)
override fun setValue(position: Int, statement: PreparedStatement, value: ByteArray?) =
statement.setBytes(position, value)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy