|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBColumnExpr
org.apache.empire.db.DBColumn
public abstract class DBColumn
This is the base class for all database columns that have a physical representation. i.e. either table or view columns (DBTableColumn oder DBViewColumn)
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 FormField Summary | |
---|---|
protected String |
comment
|
static String |
DBCOLATTR_DATETIMEPATTERN
Maximum value (Integer) |
static String |
DBCOLATTR_MANDATORY
Mandatory column (Boolean) |
static String |
DBCOLATTR_MAXVALUE
Maximum value (Integer) |
static String |
DBCOLATTR_MINVALUE
Minimum value (Integer) |
static String |
DBCOLATTR_READONLY
Read only column (Boolean) |
static String |
DBCOLATTR_SINGLEBYTECHARS
Read only column (Boolean) |
protected String |
name
|
protected DBRowSet |
rowset
|
Fields inherited from class org.apache.empire.db.DBColumnExpr |
---|
attributes, beanPropertyName, DBCOLATTR_TITLE, DBCOLATTR_TYPE, options |
Fields inherited from class org.apache.empire.db.DBExpr |
---|
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUE |
Constructor Summary | |
---|---|
protected |
DBColumn(DBRowSet rowset,
String name)
Constructs a DBColumn object and set the specified parameters to this object. |
Method Summary | |
---|---|
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 |
boolean |
equals(Object other)
|
static DBColumn |
findById(String columnId)
returns a rowset by its identifier |
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. |
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 |
abstract boolean |
isReadOnly()
Returns true if the column is read-only. |
abstract boolean |
isRequired()
Returns true if the column is required. |
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 |
Methods inherited from class org.apache.empire.db.DBColumnExpr |
---|
abs, append, as, as, asc, avg, cmp, coalesce, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, desc, detectDataType, divideBy, getBeanPropertyName, getControlType, getDataType, 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 |
Methods inherited from class org.apache.empire.db.DBExpr |
---|
getObjectValue, getValueClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.empire.data.ColumnExpr |
---|
getBeanPropertyName, getControlType, getDataType, getSourceColumn, getTitle |
Field Detail |
---|
public static final String DBCOLATTR_MANDATORY
public static final String DBCOLATTR_READONLY
public static final String DBCOLATTR_MINVALUE
public static final String DBCOLATTR_MAXVALUE
public static final String DBCOLATTR_DATETIMEPATTERN
public static final String DBCOLATTR_SINGLEBYTECHARS
protected final transient DBRowSet rowset
protected final String name
protected String comment
Constructor Detail |
---|
protected DBColumn(DBRowSet rowset, String name)
rowset
- the rowset (i.e. Table or View) that this column belongs toname
- the column nameMethod Detail |
---|
public String getId()
public static DBColumn findById(String columnId)
columnId
- the id of the column
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public abstract double getSize()
getSize
in interface Column
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 validate(Object value)
validate
in interface Column
@Deprecated public final void checkValue(Object value)
public abstract Element addXml(Element parent, long flags)
DBColumnExpr
addXml
in class DBColumnExpr
parent
- the parent element to which to append the column descriptionflags
- currently not used
public 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(StringBuilder buf, long context)
addSQL
in class DBExpr
buf
- the SQL statmentcontext
- the current SQL-Command contextpublic 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 String getFullName()
public Object getAttribute(String name)
DBColumnExpr
getAttribute
in interface ColumnExpr
getAttribute
in class DBColumnExpr
name
- the attribute name
DBColumnExpr.getAttribute(String)
public Options getOptions()
DBColumnExpr
getOptions
in interface ColumnExpr
getOptions
in class DBColumnExpr
DBColumnExpr.getOptions()
public DBSetExpr to(Object value)
value
- the Object value
DBSetExpr
public String toString()
toString
in class Object
public String getComment()
public void setComment(String comment)
comment
- the column comment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |