Package ru.curs.celesta.score
Class StringColumn
- java.lang.Object
-
- ru.curs.celesta.score.NamedElement
-
- ru.curs.celesta.score.Column<String>
-
- ru.curs.celesta.score.StringColumn
-
- All Implemented Interfaces:
ColumnMeta<String>
public final class StringColumn extends Column<String>
String column.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ru.curs.celesta.score.ColumnMeta
ColumnMeta.Ordering
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEXTCelesta type of the column data for long string.static StringVARCHARCelesta type of the column data for short string.-
Fields inherited from class ru.curs.celesta.score.NamedElement
MAX_IDENTIFIER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description StringColumn(TableElement table, String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCelestaDefault()DEFAULT value of the field in CelestaSQL language.StringgetCelestaType()Celesta data type that corresponds to the field.StringgetDefaultValue()Returns default value.Class<?>getJavaClass()Returns corresponding Java data type.intgetLength()Maximal length of the text field.booleanisMax()Indicates that on the field definition MAX parameter was provided instead of the length.StringjdbcGetterName()Name of jdbcGetter that should be used for getting column data.static StringquoteString(String lexvalue)Quotes a string.voidsetLength(String length)Sets length of the text field.static StringunquoteString(String lexvalue)Unquotes a string that is quoted.-
Methods inherited from class ru.curs.celesta.score.Column
delete, getOptions, getParentTable, isNullable, setNullableAndDefault, toString
-
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, getName, ordering
-
-
-
-
Field Detail
-
VARCHAR
public static final String VARCHAR
Celesta type of the column data for short string.- See Also:
- Constant Field Values
-
TEXT
public static final String TEXT
Celesta type of the column data for long string.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringColumn
public StringColumn(TableElement table, String name) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
unquoteString
public static String unquoteString(String lexvalue) throws ParseException
Unquotes a string that is quoted.- Parameters:
lexvalue- quoted string- Throws:
ParseException- incorrect format
-
quoteString
public static String quoteString(String lexvalue)
Quotes a string.- Parameters:
lexvalue- string for quoting
-
getDefaultValue
public String getDefaultValue()
Description copied from class:ColumnReturns default value.- Specified by:
getDefaultValuein classColumn<String>
-
getLength
public int getLength()
Maximal length of the text field. It should not be taken into account ifisMax()==true.- Returns:
-
isMax
public boolean isMax()
Indicates that on the field definition MAX parameter was provided instead of the length.- Returns:
-
setLength
public void setLength(String length) throws ParseException
Sets length of the text field.- Parameters:
length- new length- Throws:
ParseException- if zero or negative length is specified.
-
jdbcGetterName
public String jdbcGetterName()
Description copied from interface:ColumnMetaName of jdbcGetter that should be used for getting column data.- Returns:
-
getCelestaType
public String getCelestaType()
Description copied from interface:ColumnMetaCelesta data type that corresponds to the field.- Returns:
-
getJavaClass
public Class<?> getJavaClass()
Description copied from interface:ColumnMetaReturns corresponding Java data type.- Returns:
-
getCelestaDefault
public String getCelestaDefault()
Description copied from class:ColumnDEFAULT value of the field in CelestaSQL language.- Specified by:
getCelestaDefaultin classColumn<String>
-
-