public class DBTableColumn extends DBColumn
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoGenerated |
static String |
DBCOLATTR_SINGLEBYTECHARS |
protected int |
decimalScale |
protected Object |
defaultValue |
protected boolean |
readOnly |
protected boolean |
required |
protected double |
size |
protected DataType |
type |
attributes, beanPropertyName, DBCOLATTR_TITLE, DBCOLATTR_TYPE, optionsCTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUECOLATTR_CURRENCY_CODE, COLATTR_DATETIMEPATTERN, COLATTR_ENUMTYPE, COLATTR_FRACTION_DIGITS, COLATTR_INTEGER_DIGITS, COLATTR_MAXVALUE, COLATTR_MINLENGTH, COLATTR_MINVALUE, COLATTR_NULLTEXT, COLATTR_NUMBER_GROUPSEP, COLATTR_NUMBER_TYPE, COLATTR_REGEXP, COLATTR_TITLE, COLATTR_TOOLTIP, COLATTR_TYPE| Modifier | Constructor and Description |
|---|---|
|
DBTableColumn(DBTable table,
DataType type,
String name,
double size,
boolean required,
boolean autoGenerated,
Object defValue)
Constructs a DBTableColumn object set the specified parameters to this object.
|
protected |
DBTableColumn(DBTable newTable,
DBTableColumn other)
Clone Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Element |
addXml(Element parent,
long flags)
Sets field elements, default attributes and all options to
the specified Element object (XML tag).
|
DataType |
getDataType()
Returns the data type.
|
int |
getDecimalScale()
Returns the scale of the Decimal or 0 if the DataType is not DataType.DECIMAL.
|
Object |
getDefaultValue()
Returns the default column value.
|
Object |
getRecordDefaultValue(Connection conn)
Returns the default column value.
|
double |
getSize()
Gets the the column width.
|
boolean |
isAutoGenerated()
Returns true if column is a numeric sequence or otherwise generated value
|
boolean |
isReadOnly()
Checks whether the column is read only.
|
boolean |
isRequired()
Returns true if column is mandatory.
|
boolean |
isSingleByteChars()
Returns true if column the column is a single byte text or character column or false otherwise
|
DBRelation.DBReference |
referenceOn(DBTableColumn target)
Creates a foreign key relation for this column.
|
void |
setDecimalScale(int scale)
Sets the scale of a decimal.
|
void |
setDefaultValue(Object defValue)
Sets the default column value.
|
void |
setEnumOptions(Class<?> enumType)
sets the options from an enum class
|
void |
setReadOnly(boolean readOnly)
Sets the read only attribute of the column.
|
void |
setRequired(boolean required)
Changes the required property of the table column
Use for dynamic data model changes only. |
void |
setSingleByteChars(boolean singleByteChars)
sets whether this column is a single byte character or text column
|
void |
setSize(double size)
Changes the size of the table column
Use for dynamic data model changes only. |
Object |
validateValue(Object value)
Checks whether the supplied value is valid for this column.
|
addReferencedColumns, addSQL, coalesceColumn, decodeEnum, decodeSort, equals, getAlias, getAttribute, getAttributes, getComment, getDatabase, getEntityType, getEnumType, getFullName, getIdentifier, getJavaType, getName, getOptions, getRowSet, getUpdateColumn, hashCode, isAggregate, isEnum, qualified, reference, setComment, to, toStringabs, aggregate, append, as, as, asc, avg, ceiling, cmp, coalesce, concat, concat, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, decodeEnum, decodeSort, desc, divideBy, floor, format, function, getBeanPropertyName, getControlType, getExprFromPhrase, getExprFromPhrase, getSourceColumn, getTitle, in, in, in, indexOf, indexOf, indexOf, is, isBetween, isGreaterThan, isLessOrEqual, isMoreOrEqual, isNot, isNotBetween, isSmallerThan, length, like, like, likeLower, likeUpper, lower, max, min, minus, minus, modulo, month, multiplyWith, notIn, notIn, notIn, notLike, nvl, on, parenthesis, plus, plus, prepend, replace, reverse, round, setAttribute, setBeanPropertyName, setControlType, setOptions, setTitle, stringAgg, stringAgg, substring, substring, substring, substring, substring, substring, sum, toChar, toChar, trim, trimLeft, trimRight, trunc, upper, when, yearcheckParamNullclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBeanPropertyName, getControlType, getSourceColumn, getTitlepublic static final String DBCOLATTR_SINGLEBYTECHARS
protected DataType type
protected double size
protected boolean required
protected boolean autoGenerated
protected boolean readOnly
protected Object defaultValue
protected int decimalScale
public DBTableColumn(DBTable table, DataType type, String name, double size, boolean required, boolean autoGenerated, Object defValue)
table - the table object to add the column to, set to null if you don't want it added to a tabletype - the type of the column e.g. integer, text, datename - the column namesize - the column widthrequired - flag whether the column is requiredautoGenerated - flag whether the column is auto generateddefValue - the object valueprotected DBTableColumn(DBTable newTable, DBTableColumn other)
newTable - the cloned tableother - the column to clonepublic Object getDefaultValue()
public void setDefaultValue(Object defValue)
defValue - the default column valuepublic Object getRecordDefaultValue(Connection conn)
conn - a valid database connectionpublic DataType getDataType()
getDataType in interface ColumnExprgetDataType in class DBColumnExprDataTypepublic double getSize()
public void setSize(double size)
size - the new column sizepublic int getDecimalScale()
public void setDecimalScale(int scale)
scale - the number of fraction digitspublic boolean isRequired()
isRequired in interface ColumnisRequired in class DBColumnpublic boolean isAutoGenerated()
isAutoGenerated in interface ColumnisAutoGenerated in class DBColumnpublic boolean isSingleByteChars()
public void setSingleByteChars(boolean singleByteChars)
singleByteChars - flag whether single byte chars should be usedpublic void setRequired(boolean required)
required - true if the column is required or false otherwisepublic boolean isReadOnly()
isReadOnly in interface ColumnisReadOnly in class DBColumnpublic void setReadOnly(boolean readOnly)
readOnly - true if the column should be read only or false otherwisepublic void setEnumOptions(Class<?> enumType)
enumType - the enum typepublic Object validateValue(Object value)
validateValue in interface ColumnvalidateValue in class DBColumnvalue - the checked to check for validitypublic DBRelation.DBReference referenceOn(DBTableColumn target)
target - the referenced primary key columnCopyright © 2008–2023 Apache Software Foundation. All rights reserved.