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 String
TEXT
Celesta type of the column data for long string.static String
VARCHAR
Celesta 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 String
getCelestaDefault()
DEFAULT value of the field in CelestaSQL language.String
getCelestaType()
Celesta data type that corresponds to the field.String
getDefaultValue()
Returns default value.Class<?>
getJavaClass()
Returns corresponding Java data type.int
getLength()
Maximal length of the text field.boolean
isMax()
Indicates that on the field definition MAX parameter was provided instead of the length.String
jdbcGetterName()
Name of jdbcGetter that should be used for getting column data.static String
quoteString(String lexvalue)
Quotes a string.void
setLength(String length)
Sets length of the text field.static String
unquoteString(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:Column
Returns default value.- Specified by:
getDefaultValue
in 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:ColumnMeta
Name of jdbcGetter that should be used for getting column data.- Returns:
-
getCelestaType
public String getCelestaType()
Description copied from interface:ColumnMeta
Celesta data type that corresponds to the field.- Returns:
-
getJavaClass
public Class<?> getJavaClass()
Description copied from interface:ColumnMeta
Returns corresponding Java data type.- Returns:
-
getCelestaDefault
public String getCelestaDefault()
Description copied from class:Column
DEFAULT value of the field in CelestaSQL language.- Specified by:
getCelestaDefault
in classColumn<String>
-
-