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| Modifier and Type | Field and Description |
|---|---|
protected String |
comment |
protected String |
name |
protected DBRowSet |
rowset |
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 |
|---|---|
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(DBSQLBuilder sql,
long context)
Adds the colunm name to the SQL-Command.
|
abstract Element |
addXml(Element parent,
long flags)
Appends column meta information to the parent element
|
DBColumnExpr |
coalesceColumn(Object nullValue)
Creates a column expression with coalesce and renames it to this column
|
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)
Custom serialization for transient rowset.
|
String |
getAlias()
returns the qualified alias name for this column
|
Object |
getAttribute(String name)
Returns the value of a column attribute.
|
Set<Attributes.Attribute> |
getAttributes()
Returns all metadata attributes.
|
String |
getComment()
Returns a comment describing the column in the data scheme.
|
DBDatabase |
getDatabase()
Returns the database object to which this object belongs to.
|
EntityType |
getEntityType()
Returns the Entity Type
Same as getRowSet()
|
Class<Enum<?>> |
getEnumType()
Returns the enum type for this column
|
String |
getFullName()
Returns the full qualified column name.
|
String |
getIdentifier()
Gets an identifier for this RowSet Object
|
Class<?> |
getJavaType()
returns a corresponding Java type for this expression
|
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 itself as the underlying column.
|
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
|
DBColumnExpr |
reference()
Returns a reference expression for this column
This can be used to reference a parent column in a subquery
|
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 |
validateValue(Object value)
Checks if the given value is a valid value for this column
If not, an exception is thrown
|
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, 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, 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, getDataType, getSourceColumn, getTitleprotected final DBRowSet rowset
protected final String name
protected String comment
public String getIdentifier()
public boolean equals(Object other)
public 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 validateValue(Object value)
validateValue in interface Columnvalue - the value to validatepublic abstract Element addXml(Element parent, long flags)
addXml in class DBColumnExprparent - the parent element to which to append the column descriptionflags - currently not usedpublic final 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(DBSQLBuilder sql, long context)
public String getName()
getName in interface ColumnExprgetName in class DBColumnExprpublic DBRowSet getRowSet()
getRowSet in class DBColumnExprpublic EntityType getEntityType()
getEntityType in interface Columnpublic DBColumn getUpdateColumn()
getUpdateColumn in interface ColumnExprgetUpdateColumn in class DBColumnExprpublic boolean isAggregate()
isAggregate in class DBColumnExprpublic DBColumnExpr reference()
public String getFullName()
public String getAlias()
public DBColumnExpr qualified()
qualified in class DBColumnExprpublic DBColumnExpr coalesceColumn(Object nullValue)
nullValue - the alternative value when this column is nullpublic Object getAttribute(String name)
DBColumnExprgetAttribute in interface ColumnExprgetAttribute in class DBColumnExprname - the attribute nameDBColumnExpr.getAttribute(String)public Set<Attributes.Attribute> getAttributes()
getAttributes in interface Columnpublic Options getOptions()
DBColumnExprgetOptions in interface ColumnExprgetOptions in class DBColumnExprDBColumnExpr.getOptions()public final boolean isEnum()
public Class<Enum<?>> getEnumType()
getEnumType in interface ColumnExprpublic Class<?> getJavaType()
DBColumnExprgetJavaType in class DBColumnExprpublic DBColumnExpr decodeEnum()
public DBColumnExpr decodeSort(boolean defaultToEnd)
defaultToEnd - flag whether to put the default item to the endpublic DBSetExpr to(Object value)
value - the Object valueDBSetExprpublic String toString()
toString in class DBColumnExprpublic String getComment()
public void setComment(String comment)
comment - the column commentCopyright © 2008–2023 Apache Software Foundation. All rights reserved.