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 Boolean |
quoteName |
protected DBRowSet |
rowset |
attributes, beanPropertyName, optionsCTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUECOLATTR_CASESENSITIVE, COLATTR_CURRENCY_CODE, COLATTR_ENUMTYPE, COLATTR_FRACTION_DIGITS, COLATTR_INTEGER_DIGITS, COLATTR_MAXVALUE, COLATTR_MINLENGTH, COLATTR_MINVALUE, COLATTR_NORMCOLUMN, COLATTR_NULLTEXT, COLATTR_NUMBER_GROUPSEP, COLATTR_NUMBER_TYPE, COLATTR_REFCOLUMNS, COLATTR_REGEXP, COLATTR_SORTDESCENDING, COLATTR_SORTEXPRESSION, COLATTR_TITLE, COLATTR_TOOLTIP, COLATTR_TYPE, NUMTYPE_CURRENCY, NUMTYPE_DECIMAL, NUMTYPE_INTEGER, NUMTYPE_PERCENT| 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
|
DBAliasExpr |
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.
|
Entity |
getEntity()
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 the java type for this column
|
String |
getName()
Returns the column name.
|
DBColumnExpr |
getNormalizedColumn()
Returns the normalized column for the columnExpr (if any)
|
Options |
getOptions()
Returns the list of options for this column
containing all possible field values.
|
Pattern |
getRegExPattern()
Returns the maximum allowed value
|
DBRowSet |
getRowSet()
Returns DBTable, DBQuery or DBView object.
|
abstract double |
getSize()
Returns the size of the column.
|
DBColumnExpr |
getSortExpr()
Returns the sort expression for a given column
If no sort expression is explicitly set then the column itself is returned
The returned expression should be assigned to an DBCommand.orderBy() function.
|
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.
|
DBAliasExpr |
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
|
<T extends DBColumn> |
setCaseInsensitive()
Sets the case sensitivity of the column to insensitive
Text columns are case sensitive by default
|
<T extends DBColumn> |
setCaseSensitive(Boolean caseSensitiv)
Sets the case sensitivity of the columnExpr
|
void |
setComment(String comment)
Sets a comment describing the current column.
|
<T extends Column> |
setNormalizedColumn(DBColumnExpr normalizedColumn)
Sets a normalized columnExpr for this columnExpr
|
<T extends DBColumn> |
setNumberType(String numberType)
Sets the number type to a given value
|
<T extends DBColumn> |
setRegExPattern(String regex)
Set the regular expression to validate the columnExpr value
|
<T extends DBColumn> |
setSortExpr(DBColumnExpr sortExpression)
Sets a sort function expression for a given column
|
<T extends DBColumn> |
setSortExpr(String sortFunctionTemplate)
Sets a sort function template for a given 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, contains, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, decodeEnum, decodeSort, desc, divideBy, floor, format, function, getAttribute, getBeanPropertyName, getControlType, getDataType, getDefaultSortOrder, getExprFromPhrase, getExprFromPhrase, getIgnoreCaseExpr, getNumberType, getSourceColumn, getTitle, in, in, in, indexOf, indexOf, indexOf, is, isBetween, isCaseSensitive, isGreaterThan, isLessOrEqual, isLiteralValue, isMoreOrEqual, isNot, isNotBetween, isSmallerThan, length, like, like, likeLower, likeUpper, lower, max, min, minus, minus, modulo, month, multiplyWith, notContains, notIn, notIn, notIn, notLike, nvl, on, parenthesis, plus, plus, prepend, replace, reverse, round, setAttribute, setBeanPropertyName, setControlType, setDefaultSortOrder, 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, getTitle, setAttributeprotected final DBRowSet rowset
protected final String name
protected String comment
protected Boolean quoteName
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 Entity getEntity()
public DBColumn getUpdateColumn()
getUpdateColumn in interface ColumnExprgetUpdateColumn in class DBColumnExprpublic boolean isAggregate()
isAggregate in class DBColumnExprpublic DBColumnExpr reference()
public String getFullName()
public String getAlias()
public DBAliasExpr qualified()
qualified in class DBColumnExprpublic DBAliasExpr 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 DBColumnExprpublic final boolean isEnum()
public Class<Enum<?>> getEnumType()
getEnumType in interface ColumnExprpublic Class<?> getJavaType()
getJavaType in class DBColumnExprpublic <T extends DBColumn> T setCaseSensitive(Boolean caseSensitiv)
caseSensitiv - the character casing. This may be true, false or null (default)public final <T extends DBColumn> T setCaseInsensitive()
public final <T extends DBColumn> T setNumberType(String numberType)
numberType - the number type. See Column.NUMTYPE_... constantspublic Pattern getRegExPattern()
public <T extends DBColumn> T setRegExPattern(String regex)
regex - the regular expressionpublic DBColumnExpr getNormalizedColumn()
public <T extends Column> T setNormalizedColumn(DBColumnExpr normalizedColumn)
normalizedColumn - the normalized columnExprpublic DBColumnExpr getSortExpr()
public <T extends DBColumn> T setSortExpr(DBColumnExpr sortExpression)
sortExpression - the expression which to use for sortingpublic DBColumnExpr decodeEnum()
public DBColumnExpr decodeSort(boolean defaultToEnd)
defaultToEnd - flag whether to put the default item to the endpublic <T extends DBColumn> T setSortExpr(String sortFunctionTemplate)
sortFunctionTemplate - the template which must contain a ? which will be replaced with the column namepublic 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.