org.apache.empire.db
Class DBExpr

java.lang.Object
  extended by org.apache.empire.db.DBObject
      extended by org.apache.empire.db.DBExpr
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DBCmdParam, DBColumnExpr, 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)

See Also:
Serialized Form

Field Summary
static long CTX_ALIAS
           
static long CTX_ALL
           
static long CTX_DEFAULT
           
static long CTX_FULLNAME
           
static long CTX_NAME
           
static long CTX_NOPARENTHESES
           
static long CTX_VALUE
           
 
Constructor Summary
DBExpr()
           
 
Method Summary
abstract  void addReferencedColumns(Set<DBColumn> list)
          Internal function to obtain all DBColumnExpr-objects used by this expression.
abstract  void addSQL(StringBuilder buf, long context)
          Used to build the SQL command.
protected  String getObjectValue(DataType dataType, Object value, long context, String arraySep)
          Returns the sql representation of a value.
static Class getValueClass(DataType type)
          Returns the java class type for a given dataType
 
Methods inherited from class org.apache.empire.db.DBObject
getDatabase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

DBExpr

public DBExpr()
Method Detail

addSQL

public abstract void addSQL(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 command
context - context flag for this SQL-Command (see CTX_??? constants).

addReferencedColumns

public abstract void addReferencedColumns(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 String getObjectValue(DataType dataType,
                                Object value,
                                long context,
                                String arraySep)
Returns the sql representation of a value.

Parameters:
dataType - the DataType
value - an DBExpr object, array or a basis data type(e.g. int, String)
context - the context of the DBColumnExpr object
arraySep - the separator value
Returns:
the new SQL-Command

getValueClass

public static final 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-2012 Apache Software Foundation. All Rights Reserved.