|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.commons.ErrorObject
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBColumnExpr
org.apache.empire.db.DBColumn
org.apache.empire.db.DBTableColumn
public class DBTableColumn
This class represent one column of a table. It contains all properties of this columns (e.g. the column width).
Field Summary |
---|
Fields inherited from class org.apache.empire.db.DBColumn |
---|
DBCOLATTR_MANDATORY, DBCOLATTR_READONLY |
Fields inherited from class org.apache.empire.db.DBColumnExpr |
---|
DBCOLATTR_TITLE, DBCOLATTR_TYPE |
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 | |
---|---|
DBTableColumn(DBTable table,
DataType type,
java.lang.String name,
double size,
boolean required,
java.lang.Object defValue)
Constructs a DBTableColumn object set the specified parameters to this object. |
Method Summary | |
---|---|
org.w3c.dom.Element |
addXml(org.w3c.dom.Element parent,
long flags)
Sets field elements, default attributes and all otions to the specified Element object (XML tag). |
boolean |
checkValue(java.lang.Object value)
Checks whether the supplied value is valid for this column. |
DataType |
getDataType()
Returns the data type. |
java.lang.Object |
getDefaultValue()
Returns the default column value. |
java.lang.Object |
getRecordDefaultValue(java.sql.Connection conn)
Returns the default column value. |
double |
getSize()
Gets the the column width. |
boolean |
isReadOnly()
Checks whether the column is read only. |
boolean |
isRequired()
Returns true if column is mandatory. |
DBRelation.DBReference |
referenceOn(DBTableColumn target)
Creates a foreign key relation for this column. |
void |
setDefaultValue(java.lang.Object defValue)
Sets the default column value. |
void |
setReadOnly(boolean readOnly)
Sets the read only attribute of the column. |
void |
setRequired(boolean required)
Changes the requied property of the table column Use for dynamic data model changes only. |
void |
setSize(double size)
Changes the size of the table column Use for dynamic data model changes only. |
Methods inherited from class org.apache.empire.db.DBColumn |
---|
addReferencedColumns, addSQL, getAttribute, getComment, getDatabase, getFullName, getName, getOptions, getRowSet, getUpdateColumn, isAggregate, setComment, to, toString |
Methods inherited from class org.apache.empire.db.DBColumnExpr |
---|
abs, append, as, as, avg, cmp, coalesce, convertTo, convertTo, count, countDistinct, day, decode, decode, decode, decode, decode, decode, divideBy, getBeanPropertyName, getControlType, 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 |
---|
getValueClass |
Methods inherited from class org.apache.empire.commons.ErrorObject |
---|
clearError, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, isExceptionsEnabled, setExceptionsEnabled |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.empire.data.ColumnExpr |
---|
getBeanPropertyName, getControlType, getSourceColumn, getTitle |
Constructor Detail |
---|
public DBTableColumn(DBTable table, DataType type, java.lang.String name, double size, boolean required, java.lang.Object defValue)
type
- the type of the column e.g. integer, text, datename
- the column namesize
- the column widthrequired
- true if not null columndefValue
- the object valueMethod Detail |
---|
public java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object defValue)
defValue
- the default column valuepublic java.lang.Object getRecordDefaultValue(java.sql.Connection conn)
conn
- a valid database connection
public DataType getDataType()
getDataType
in interface ColumnExpr
getDataType
in class DBColumnExpr
DataType
public double getSize()
getSize
in interface Column
getSize
in class DBColumn
public void setSize(double size)
size
- the new column sizepublic boolean isRequired()
isRequired
in interface Column
isRequired
in class DBColumn
public void setRequired(boolean required)
required
- true if the column is requried or false otherwisepublic boolean isReadOnly()
isReadOnly
in interface Column
isReadOnly
in class DBColumn
public void setReadOnly(boolean readOnly)
readOnly
- true if the column should be read only or false otherwisepublic boolean checkValue(java.lang.Object value)
checkValue
in class DBColumn
value
- the checked to check for validity
public DBRelation.DBReference referenceOn(DBTableColumn target)
target
- the referenced primary key columnpublic org.w3c.dom.Element addXml(org.w3c.dom.Element parent, long flags)
addXml
in class DBColumn
parent
- the parent objectflags
- a long value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |