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, 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 |
---|---|
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 |
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.
|
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 |
getSourceColumn()
Returns itself as the source column.
|
DBColumn |
getUpdateColumn()
Returns itself as the update 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, 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, getDataType, getTitle
protected 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 Column
public abstract boolean isAutoGenerated()
isAutoGenerated
in interface Column
public abstract boolean isReadOnly()
isReadOnly
in interface Column
public abstract Object validateValue(Object value)
validateValue
in interface Column
value
- the value to validatepublic abstract Element addXml(Element parent, long flags)
addXml
in class DBColumnExpr
parent
- the parent element to which to append the column descriptionflags
- currently not usedpublic final DBDatabase getDatabase()
DBObject
getDatabase
in class DBObject
public void addReferencedColumns(Set<DBColumn> list)
DBExpr
addReferencedColumns
in class DBExpr
list
- list to which all used column expressions must be addedDBExpr.addReferencedColumns(Set)
public void addSQL(DBSQLBuilder sql, long context)
public DBColumn getSourceColumn()
getSourceColumn
in interface ColumnExpr
getSourceColumn
in class DBColumnExpr
public DBColumn getUpdateColumn()
getUpdateColumn
in class DBColumnExpr
public boolean isAggregate()
isAggregate
in class DBColumnExpr
public DBRowSet getRowSet()
public String getName()
getName
in interface ColumnExpr
getName
in class DBColumnExpr
public DBColumnExpr reference()
public String getFullName()
public String getAlias()
public DBColumnExpr qualified()
qualified
in class DBColumnExpr
public Object getAttribute(String name)
DBColumnExpr
getAttribute
in interface ColumnExpr
getAttribute
in class DBColumnExpr
name
- the attribute nameDBColumnExpr.getAttribute(String)
public Set<Attributes.Attribute> getAttributes()
getAttributes
in interface Column
public Options getOptions()
DBColumnExpr
getOptions
in interface ColumnExpr
getOptions
in class DBColumnExpr
DBColumnExpr.getOptions()
public final boolean isEnum()
public Class<Enum<?>> getEnumType()
getEnumType
in interface ColumnExpr
public Class<?> getJavaType()
DBColumnExpr
getJavaType
in class DBColumnExpr
public DBColumnExpr decodeEnum()
public DBColumnExpr decodeSort(boolean defaultToEnd)
public DBSetExpr to(Object value)
value
- the Object valueDBSetExpr
public String toString()
toString
in class DBColumnExpr
public String getComment()
public void setComment(String comment)
comment
- the column commentCopyright © 2008–2023 Apache Software Foundation. All rights reserved.