public class DBTableColumn extends DBColumn
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoGenerated |
protected int |
decimalScale |
protected Object |
defaultValue |
protected boolean |
readOnly |
protected boolean |
required |
protected double |
size |
protected DataType |
type |
comment, DBCOLATTR_SINGLEBYTECHARS, name, rowsetattributes, beanPropertyName, DBCOLATTR_TITLE, DBCOLATTR_TYPE, optionsCTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUECOLATTR_CURRENCY_CODE, COLATTR_DATETIMEPATTERN, COLATTR_ENUMTYPE, COLATTR_FRACTION_DIGITS, COLATTR_INTEGER_DIGITS, COLATTR_MAXVALUE, COLATTR_MINLENGTH, COLATTR_MINVALUE, 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.
|
|
DBTableColumn(DBTable table,
DataType type,
String name,
double size,
DataMode dataMode,
Object defValue)
|
protected |
DBTableColumn(DBTable newTable,
DBTableColumn other)
Clone Constructor - use clone()
|
| 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.
|
String |
getSequenceName()
Gets the sequence name for this table's sequence (if it has one)
This is derived form the default value or auto generated if no default value is set
|
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 |
validate(Object value)
Checks whether the supplied value is valid for this column.
|
protected void |
validateNumber(DataType type,
Number n) |
addReferencedColumns, addSQL, checkValue, decodeEnum, decodeSort, equals, findById, getAlias, getAttribute, getComment, getDatabase, getEnumType, getFullName, getId, getName, getOptions, getRowSet, getUpdateColumn, hashCode, isAggregate, isEnum, qualified, setComment, to, toStringabs, append, as, as, asc, avg, ceiling, cmp, coalesce, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, decodeEnum, decodeSort, desc, divideBy, floor, format, 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, parenthesis, plus, plus, replace, reverse, round, setAttribute, setBeanPropertyName, setControlType, setOptions, setTitle, substring, substring, substring, substring, substring, substring, sum, toChar, toChar, trim, trimLeft, trimRight, trunc, upper, when, yeargetObjectValue, getValueClassclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBeanPropertyName, getControlType, getSourceColumn, getTitleprotected 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 widthdataMode - determines whether this column is optional, required or auto-generateddefValue - the object value@Deprecated public DBTableColumn(DBTable table, DataType type, String name, double size, DataMode dataMode, Object defValue)
DBTableColumn(DBTable table, DataType type, String name, double size, boolean required, boolean autoGenerated, Object defValue) instead.protected DBTableColumn(DBTable newTable, DBTableColumn other)
public 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)
public 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)
public 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)
public Object validate(Object value)
public DBRelation.DBReference referenceOn(DBTableColumn target)
target - the referenced primary key columnpublic Element addXml(Element parent, long flags)
public String getSequenceName()
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.