Package ru.curs.celesta.score
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ru.curs.celesta.score.ColumnMeta
ColumnMeta.Ordering
-
-
Field Summary
-
Fields inherited from class ru.curs.celesta.score.NamedElement
MAX_IDENTIFIER_LENGTH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddelete()Deletes the column.abstract StringgetCelestaDefault()DEFAULT value of the field in CelestaSQL language.abstract VgetDefaultValue()Returns default value.List<String>getOptions()Returns options (the value ofoptionproperty) for current field.TableElementgetParentTable()Returns table that current column belongs to.booleanisNullable()Returns the value of Nullable property.voidsetNullableAndDefault(boolean nullable, String defaultValue)Sets property Nullable and default value.StringtoString()-
Methods inherited from class ru.curs.celesta.score.NamedElement
equals, getCelestaDoc, getName, getQuotedName, getQuotedNameIfNeeded, hashCode, limitName, limitName, setCelestaDoc
-
Methods inherited from interface ru.curs.celesta.score.ColumnMeta
asc, desc, getCelestaDoc, getCelestaType, getJavaClass, getName, jdbcGetterName, ordering
-
-
-
-
Method Detail
-
getOptions
public List<String> getOptions()
Returns options (the value ofoptionproperty) for current field. It is applicable only for text and Integer fields.- Throws:
CelestaException- in case if options are provided incorrectly.
-
getParentTable
public final TableElement getParentTable()
Returns table that current column belongs to.
-
setNullableAndDefault
public final void setNullableAndDefault(boolean nullable, String defaultValue) throws ParseExceptionSets property Nullable and default value.- Parameters:
nullable- property NullabledefaultValue- 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:
isNullablein interfaceColumnMeta<V>- Returns:
-
delete
public final void delete() throws ParseExceptionDeletes 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.
-
-