org.apache.empire.db
Class DBCombinedCmd

java.lang.Object
  extended by org.apache.empire.commons.ErrorObject
      extended by org.apache.empire.db.DBObject
          extended by org.apache.empire.db.DBExpr
              extended by org.apache.empire.db.DBCommandExpr
                  extended by org.apache.empire.db.DBCombinedCmd
All Implemented Interfaces:
ErrorInfo

public class DBCombinedCmd
extends DBCommandExpr

This class is used for building up a partition of a SQL-Command. It handles the insert from a specified key word between two DBCommandExpr objects.


Field Summary
 
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
DBCombinedCmd(DBCommandExpr left, java.lang.String keyWord, DBCommandExpr right)
          Constructs a new DBFuncExpr object and sets the specified parameters to this object.
 
Method Summary
 void addReferencedColumns(java.util.Set<DBColumn> list)
          Internal function to obtain all DBColumnExpr-objects used by this expression.
 DBDatabase getDatabase()
          Returns the current DBDatabase object.
 boolean getSelect(java.lang.StringBuilder buf)
          Creates the SQL-Command.
 DBColumnExpr[] getSelectExprList()
          Calls the method dbDBCommandExpr.getSelectExprList from the private variable 'left'.
 boolean isValid()
           
 void orderBy(DBColumnExpr expr, boolean desc)
          This helper function adds the DBColumnExpr objects to the Vector: 'orderBy'.
 
Methods inherited from class org.apache.empire.db.DBCommandExpr
addSQL, clearOrderBy, getCmdColumn, getCmdColumn, getInsertInto, getInsertInto, getSelect, intersect, orderBy, union
 
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, toString, wait, wait, wait
 

Constructor Detail

DBCombinedCmd

public DBCombinedCmd(DBCommandExpr left,
                     java.lang.String keyWord,
                     DBCommandExpr right)
Constructs a new DBFuncExpr object and sets the specified parameters to this object.

Parameters:
left - the first DBCommandExpr object
keyWord - the key word between the wo DBCommandExpr objects
right - the second DBCommandExpr object
Method Detail

isValid

public boolean isValid()
Specified by:
isValid in class DBCommandExpr

getDatabase

public DBDatabase getDatabase()
Returns the current DBDatabase object.

Specified by:
getDatabase in class DBObject
Returns:
the current DBDatabase object

addReferencedColumns

public void addReferencedColumns(java.util.Set<DBColumn> list)
Description copied from class: DBExpr
Internal function to obtain all DBColumnExpr-objects used by this expression.

Specified by:
addReferencedColumns in class DBExpr
Parameters:
list - list to which all used column expressions must be added
See Also:
DBExpr.addReferencedColumns(Set)

getSelectExprList

public DBColumnExpr[] getSelectExprList()
Calls the method dbDBCommandExpr.getSelectExprList from the private variable 'left'. Returns a array of all DBColumnExpr object of the Vector: 'select'.

Specified by:
getSelectExprList in class DBCommandExpr
Returns:
returns an array of all DBColumnExpr object of the Vector: 'select'
See Also:
DBCommandExpr.getSelectExprList()

getSelect

public boolean getSelect(java.lang.StringBuilder buf)
Creates the SQL-Command.

Specified by:
getSelect in class DBCommandExpr
Parameters:
buf - the SQL-Command
Returns:
true if the creation was successful

orderBy

public void orderBy(DBColumnExpr expr,
                    boolean desc)
This helper function adds the DBColumnExpr objects to the Vector: 'orderBy'.

Overrides:
orderBy in class DBCommandExpr
Parameters:
expr - the first DBColumnExpr object
desc - an boolean value