Class ColumnBase
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.model.ColumnBase
-
- Direct Known Subclasses:
BigIntColumn
,BlobColumn
,CharColumn
,ClobColumn
,DoubleColumn
,IntColumn
,SmallIntBooleanColumn
,SmallIntColumn
,TimestampColumn
,VarbinaryColumn
,VarcharColumn
public abstract class ColumnBase extends java.lang.Object
An immutable definition of a column in a table
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ColumnBase(java.lang.String name, boolean nullable)
Protected constructor - for use by subclassesprotected
ColumnBase(java.lang.String name, boolean nullable, java.lang.String defaultVal)
Protected constructor - for use by subclasses
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDefaultVal()
Getter for the default value of this columnjava.lang.String
getName()
Getter for the namejava.lang.String
getTypeDef(IDatabaseTypeAdapter adapter)
Get the definition of this column as used in create table and create type statements.abstract java.lang.String
getTypeInfo(IDatabaseTypeAdapter adapter)
Get the type info stringboolean
isNullable()
Getter for the null flagvoid
resetDefaultValue()
resets the default value.
-
-
-
Constructor Detail
-
ColumnBase
protected ColumnBase(java.lang.String name, boolean nullable)
Protected constructor - for use by subclasses- Parameters:
name
-nullable
-
-
ColumnBase
protected ColumnBase(java.lang.String name, boolean nullable, java.lang.String defaultVal)
Protected constructor - for use by subclasses- Parameters:
name
-nullable
-defaultVal
-
-
-
Method Detail
-
resetDefaultValue
public void resetDefaultValue()
resets the default value.
-
getName
public java.lang.String getName()
Getter for the name- Returns:
-
isNullable
public boolean isNullable()
Getter for the null flag- Returns:
-
getDefaultVal
public java.lang.String getDefaultVal()
Getter for the default value of this column- Returns:
- possibly null
-
getTypeInfo
public abstract java.lang.String getTypeInfo(IDatabaseTypeAdapter adapter)
Get the type info string- Parameters:
adapter
-- Returns:
-
getTypeDef
public java.lang.String getTypeDef(IDatabaseTypeAdapter adapter)
Get the definition of this column as used in create table and create type statements. Simply the name followed by the data type- Parameters:
adapter
-- Returns:
-
-