public class DBTableColumn extends DBColumn
Modifier and Type | Field and Description |
---|---|
protected DataMode |
dataMode |
protected int |
decimalScale |
protected Object |
defValue |
protected double |
size |
protected DataType |
type |
comment, DBCOLATTR_DATETIMEPATTERN, DBCOLATTR_MANDATORY, DBCOLATTR_MAXVALUE, DBCOLATTR_MINVALUE, DBCOLATTR_READONLY, DBCOLATTR_SINGLEBYTECHARS, name, rowset
attributes, beanPropertyName, DBCOLATTR_TITLE, DBCOLATTR_TYPE, options
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUE
Modifier | Constructor and Description |
---|---|
|
DBTableColumn(DBTable table,
DataType type,
String name,
double size,
DataMode dataMode,
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.
|
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 |
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, equals, findById, getAttribute, getComment, getDatabase, getFullName, getId, getName, getOptions, getRowSet, getUpdateColumn, hashCode, isAggregate, setComment, to, toString
abs, append, as, as, asc, avg, cmp, coalesce, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, desc, detectDataType, divideBy, getBeanPropertyName, getControlType, getExprFromPhrase, getExprFromPhrase, getSourceColumn, getTitle, in, indexOf, indexOf, indexOf, is, isBetween, isGreaterThan, isLessOrEqual, isMoreOrEqual, isNot, isNotBetween, isSmallerThan, length, like, like, likeLower, likeUpper, lower, max, min, minus, minus, month, multiplyWith, 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, year
getObjectValue, getValueClass
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBeanPropertyName, getControlType, getSourceColumn, getTitle
protected DataType type
protected double size
protected DataMode dataMode
protected Object defValue
protected int decimalScale
public DBTableColumn(DBTable table, DataType type, String name, double size, DataMode dataMode, 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 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 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–2015 Apache Software Foundation. All rights reserved.