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, options
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE
COLATTR_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 - 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.
|
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, decodeEnum, decodeSort, equals, getAlias, getAttribute, getAttributes, getComment, getDatabase, getEntityType, getEnumType, getFullName, getIdentifier, getJavaType, getName, getOptions, getRowSet, getUpdateColumn, hashCode, isAggregate, isEnum, qualified, reference, setComment, to, toString
abs, 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, 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, year
checkParamNull
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBeanPropertyName, getControlType, getSourceColumn, getTitle
public 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)
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 ColumnExpr
getDataType
in class DBColumnExpr
DataType
public 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 Column
isRequired
in class DBColumn
public boolean isAutoGenerated()
isAutoGenerated
in interface Column
isAutoGenerated
in class DBColumn
public 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 Column
isReadOnly
in class DBColumn
public void setReadOnly(boolean readOnly)
readOnly
- true if the column should be read only or false otherwisepublic void setEnumOptions(Class<?> enumType)
public Object validateValue(Object value)
validateValue
in interface Column
validateValue
in class DBColumn
value
- 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.