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

com.dbobjekts.codegen.metadata.ColumnMetaData.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0-RC2
Show newest version
package com.dbobjekts.codegen.metadata

import com.dbobjekts.api.ColumnName

data class ColumnMetaData(
    val columnName: ColumnName = ColumnName(""),
    val columnType: String,
    val isAutoIncrement: Boolean = false,
    val isPrimaryKey: Boolean = false,
    val remarks: String? = null,
    val nullable: Boolean = false
) {

    override fun toString(): String {
        val isNull = if(nullable) "NULL" else "NOT NULL"
        val isPK = if(isPrimaryKey) " PRIMARY KEY" else ""
        val increment = if (isAutoIncrement) " AUTO_INCREMENT" else ""
        return "$columnName $columnType $isNull$isPK$increment"
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy