org.apache.empire.db
Class DBExpr
java.lang.Object
org.apache.empire.commons.ErrorObject
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
- All Implemented Interfaces:
- ErrorInfo
- Direct Known Subclasses:
- DBColumnExpr, DBCommand.DBCmdParameter, DBCommandExpr, DBCompareExpr, DBJoinExpr, DBOrderByExpr, DBRowSet, DBSetExpr
public abstract class DBExpr
- extends DBObject
This abstract class is the base class for all database expression classes (e.g. DBAliasExpr or DBCalsExpr)
Method Summary |
abstract void |
addReferencedColumns(java.util.Set<DBColumn> list)
Internal function to obtain all DBColumnExpr-objects used by this expression. |
abstract void |
addSQL(java.lang.StringBuilder buf,
long context)
Used to build the SQL command. |
protected java.lang.String |
getObjectValue(DataType dataType,
java.lang.Object value,
long context,
java.lang.String arraySep)
Returns the sql representation of a value. |
static java.lang.Class |
getValueClass(DataType type)
Returns the java class type for a given dataType |
Methods inherited from class org.apache.empire.commons.ErrorObject |
clearError, clearErrorInfo, error, error, error, error, error, error, error, getErrorInfo, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, internalSetError, isExceptionsEnabled, setExceptionsEnabled, success |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CTX_DEFAULT
public static final long CTX_DEFAULT
- See Also:
- Constant Field Values
CTX_ALL
public static final long CTX_ALL
- See Also:
- Constant Field Values
CTX_NAME
public static final long CTX_NAME
- See Also:
- Constant Field Values
CTX_FULLNAME
public static final long CTX_FULLNAME
- See Also:
- Constant Field Values
CTX_VALUE
public static final long CTX_VALUE
- See Also:
- Constant Field Values
CTX_ALIAS
public static final long CTX_ALIAS
- See Also:
- Constant Field Values
CTX_NOPARENTHESES
public static final long CTX_NOPARENTHESES
- See Also:
- Constant Field Values
log
protected static final org.apache.commons.logging.Log log
DBExpr
public DBExpr()
addSQL
public abstract void addSQL(java.lang.StringBuilder buf,
long context)
- Used to build the SQL command. SQL for this expression must be appended to StringBuilder.
- Parameters:
buf
- the string buffer used to build the sql commandcontext
- context flag for this SQL-Command (see CTX_??? constants).
addReferencedColumns
public abstract void addReferencedColumns(java.util.Set<DBColumn> list)
- Internal function to obtain all DBColumnExpr-objects used by this expression.
- Parameters:
list
- list to which all used column expressions must be added
getObjectValue
protected java.lang.String getObjectValue(DataType dataType,
java.lang.Object value,
long context,
java.lang.String arraySep)
- Returns the sql representation of a value.
- Parameters:
dataType
- the DataTypevalue
- an DBExpr object, array or a basis data type(e.g. int, String)context
- the context of the DBColumnExpr objectarraySep
- the separator value
- Returns:
- the new SQL-Command
getValueClass
public static final java.lang.Class getValueClass(DataType type)
- Returns the java class type for a given dataType
- Parameters:
type
- the data type
- Returns:
- return the java class used for storing values of this dataType
Copyright © 2008-2010 Apache Software Foundation. All Rights Reserved.