Class Column<V>

java.lang.Object
ru.curs.celesta.score.NamedElement
ru.curs.celesta.score.Column<V>
Type Parameters:
V - Java class of column value
All Implemented Interfaces:
ColumnMeta<V>
Direct Known Subclasses:
BinaryColumn, BooleanColumn, DateTimeColumn, DecimalColumn, FloatingColumn, IntegerColumn, StringColumn, ZonedDateTimeColumn

public abstract class Column<V> extends NamedElement implements ColumnMeta<V>
Base class for describing a table column. Subclasses of this class correspond to different column types.
  • Method Details

    • getOptions

      public List<String> getOptions()
      Returns options (the value of option property) for current field. It is applicable only for text and Integer fields.
      Throws:
      CelestaException - in case if options are provided incorrectly.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getParentTable

      public final TableElement getParentTable()
      Returns table that current column belongs to.
    • setNullableAndDefault

      public final void setNullableAndDefault(boolean nullable, String defaultValue) throws ParseException
      Sets property Nullable and default value.
      Parameters:
      nullable - property Nullable
      defaultValue - default value
      Throws:
      ParseException - in case if DEFAULT value has an incorrect format.
    • isNullable

      public final boolean isNullable()
      Returns the value of Nullable property.
      Specified by:
      isNullable in interface ColumnMeta<V>
      Returns:
    • delete

      public final void delete() throws ParseException
      Deletes the column.
      Throws:
      ParseException - if a part of the primary key, or a foreign key, or an index is being deleted.
    • getDefaultValue

      public abstract V getDefaultValue()
      Returns default value.
    • getCelestaDefault

      public abstract String getCelestaDefault()
      DEFAULT value of the field in CelestaSQL language.