
io.github.guttenbase.meta.ColumnMetaData.kt Maven / Gradle / Ivy
package io.github.guttenbase.meta
import java.io.Serializable
import java.sql.Types
/**
* Information about a table column.
*
* © 2012-2034 akquinet tech@spree
*
* @author M. Dahm
*/
interface ColumnMetaData : Comparable, Serializable {
/**
* Column type as defined in [java.sql.Types]
*/
val columnType: Int
val columnName: String
val columnTypeName: String
val columnClassName: String
/**
* @return containing table
*/
val tableMetaData: TableMetaData
val isNullable: Boolean
val isAutoIncrement: Boolean
val precision: Int
val scale: Int
val isPrimaryKey: Boolean
/**
* @return referenced columns for each foreign key constraint
*/
val referencedColumns: Map>
/**
* @return list of referencing columns for each foreign key constraint
*/
val referencingColumns: Map>
}
fun Int.isNumericType() = this in listOf(Types.SMALLINT, Types.NUMERIC, Types.DECIMAL, Types.BIGINT, Types.INTEGER)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy