public abstract class DBColumn extends DBColumnExpr implements Column
The column object describes a database column and thus provides metadata. Other non data model specific metadata may be added through attributes.
DBTableColumn,
DBView.DBViewColumn,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected String |
comment |
static String |
DBCOLATTR_SINGLEBYTECHARS
Read only column (Boolean)
|
protected String |
name |
protected DBRowSet |
rowset |
attributes, 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 |
|---|---|
protected |
DBColumn(DBRowSet rowset,
String name)
Constructs a DBColumn object and set the specified parameters to this object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReferencedColumns(Set<DBColumn> list)
Internal function to obtain all DBColumnExpr-objects used by this expression.
|
void |
addSQL(StringBuilder buf,
long context)
Adds the colunm name to the SQL-Command.
|
abstract Element |
addXml(Element parent,
long flags)
Add a description of this column with relevant metadata
to the supplied parent XML Element.
|
void |
checkValue(Object value)
Deprecated.
use validate() instead
|
DBColumnExpr |
decodeEnum()
Creates and returns a sql-expression that maps enum values by name or ordinal to their string representation
|
DBColumnExpr |
decodeSort(boolean defaultToEnd)
Creates and returns a sql-expression that maps enum values from name to ordinal
|
boolean |
equals(Object other) |
static DBColumn |
findById(String columnId)
returns a rowset by its identifier
|
String |
getAlias()
returns the qualified alias name for this column
|
Object |
getAttribute(String name)
Returns the value of a column attribute.
|
String |
getComment()
Returns a comment describing the column in the data scheme.
|
DBDatabase |
getDatabase()
Returns the database object to which this object belongs to.
|
Class<Enum<?>> |
getEnumType()
Returns the enum type for this column
|
String |
getFullName()
Returns the full qualified column name.
|
String |
getId()
Gets an identifier for this RowSet Object
|
String |
getName()
Returns the column name.
|
Options |
getOptions()
Returns the list of options for this column
containing all possible field values.
|
DBRowSet |
getRowSet()
Returns DBTable, DBQuery or DBView object.
|
abstract double |
getSize()
Returns the size of the column.
|
DBColumn |
getUpdateColumn()
Returns this object.
|
int |
hashCode() |
boolean |
isAggregate()
Always returns false since DBColumns cannot be aggregates.
|
abstract boolean |
isAutoGenerated()
Returns true if column is a columns value is an automatically generated value
|
boolean |
isEnum()
Returns true if an enum type has been set for this column
|
abstract boolean |
isReadOnly()
Returns true if the column is read-only.
|
abstract boolean |
isRequired()
Returns true if the column is required.
|
DBColumnExpr |
qualified()
returns an expression that renames the column with its alias name
|
void |
setComment(String comment)
Sets a comment describing the current column.
|
DBSetExpr |
to(Object value)
Creates and returns a new DBSetExpr object.
|
String |
toString()
Override the toString method.
|
abstract Object |
validate(Object value)
Checks if the given value is a valid value for this column
If not, an exception is thrown
|
abs, 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, getDataType, 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, getDataType, getSourceColumn, getTitlepublic static final String DBCOLATTR_SINGLEBYTECHARS
protected final transient DBRowSet rowset
protected final String name
protected String comment
public String getId()
public static DBColumn findById(String columnId)
columnId - the id of the columnpublic abstract double getSize()
public abstract boolean isRequired()
isRequired in interface Columnpublic abstract boolean isAutoGenerated()
isAutoGenerated in interface Columnpublic abstract boolean isReadOnly()
isReadOnly in interface Columnpublic abstract Object validate(Object value)
@Deprecated public final void checkValue(Object value)
public abstract Element addXml(Element parent, long flags)
DBColumnExpraddXml in class DBColumnExprparent - the parent element to which to append the column descriptionflags - currently not usedpublic DBDatabase getDatabase()
DBObjectgetDatabase in class DBObjectpublic void addReferencedColumns(Set<DBColumn> list)
DBExpraddReferencedColumns in class DBExprlist - list to which all used column expressions must be addedDBExpr.addReferencedColumns(Set)public void addSQL(StringBuilder buf, long context)
public DBColumn getUpdateColumn()
getUpdateColumn in class DBColumnExprpublic boolean isAggregate()
isAggregate in class DBColumnExprpublic DBRowSet getRowSet()
public String getName()
getName in interface ColumnExprgetName in class DBColumnExprpublic String getFullName()
public String getAlias()
public DBColumnExpr qualified()
public Object getAttribute(String name)
DBColumnExprgetAttribute in interface ColumnExprgetAttribute in class DBColumnExprname - the attribute nameDBColumnExpr.getAttribute(String)public Options getOptions()
DBColumnExprgetOptions in interface ColumnExprgetOptions in class DBColumnExprDBColumnExpr.getOptions()public final boolean isEnum()
public Class<Enum<?>> getEnumType()
getEnumType in interface Columnpublic DBColumnExpr decodeEnum()
public DBColumnExpr decodeSort(boolean defaultToEnd)
public DBSetExpr to(Object value)
value - the Object valueDBSetExprpublic String toString()
public String getComment()
public void setComment(String comment)
comment - the column commentCopyright © 2008–2022 Apache Software Foundation. All rights reserved.