Package org.apache.empire.db
Class DBCombinedCmd
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBCommandExpr
org.apache.empire.db.DBCombinedCmd
This class is used for combining two DBCommandExpr objects to a new single DBCommandExpr
This may be used to create "UNION" or "INTERSECT" queries
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.empire.db.DBCommandExpr
DBCommandExpr.DBCmdColumn, DBCommandExpr.DBCmdQuery -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBCmdParamListprotected Stringprotected DBCommandExprprotected DBCommandExprFields inherited from class org.apache.empire.db.DBCommandExpr
cmdQuery, orderBy, SF_DEFAULT, SF_SKIP_FROM, SF_SKIP_GROUP, SF_SKIP_LIMIT, SF_SKIP_ORDER, SF_SKIP_SELECT, SF_SKIP_WHEREFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionDBCombinedCmd(DBCommandExpr left, String keyWord, DBCommandExpr right) Constructs a new DBFuncExpr object and sets the specified parameters to this object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.protected DBSQLBuildercreateSQLBuilder(String initalSQL) creates a new DBSQLBuilderfinal DBDatabaseReturns the current DBDatabase object.Returns the DataType selected by this command if only one column is returned If the command has more than one select expression DataType.UNKNOWN will be returnedObject[]Returns the list of parameter values for a prepared statement.voidgetSelect(DBSQLBuilder sql, int flags) Creates the SQL-Command.Returns all select expressions as unmodifiable listCalls the method dbDBCommandExpr.getSelectExprList from the private variable 'left'.booleanreturns whether or not the command has any select expressionbooleanhasSelectExpr(DBColumnExpr expr) returns whether or not the command has a specific select expressionbooleanisValid()orderBy(DBOrderByExpr... exprs) Adds an order by expression the commandMethods inherited from class org.apache.empire.db.DBCommandExpr
addListExpr, addSQL, clearLimit, clearOrderBy, clone, getCmdColumn, getDbms, getInsertInto, getInsertInto, getInsertInto, getOrderBy, getSelect, getSelect, hasOrderBy, intersect, limitRows, not, notEmpty, orderBy, orderBy, orderByUpper, orderByUpper, result, skipRows, union, unionAllMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Field Details
-
left
-
right
-
keyWord
-
cmdParams
-
-
Constructor Details
-
DBCombinedCmd
Constructs a new DBFuncExpr object and sets the specified parameters to this object.- Parameters:
left- the first DBCommandExpr objectkeyWord- the key word between the two DBCommandExpr objectsright- the second DBCommandExpr object
-
-
Method Details
-
createSQLBuilder
Description copied from class:DBCommandExprcreates a new DBSQLBuilder- Overrides:
createSQLBuilderin classDBCommandExpr- Parameters:
initalSQL- the initial sql fragment- Returns:
- the new DBSQLBuilder
-
isValid
public boolean isValid()- Specified by:
isValidin classDBCommandExpr
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
addReferencedColumns
Description copied from class:DBExprInternal function to obtain all DBColumnExpr-objects used by this expression.- Specified by:
addReferencedColumnsin classDBExpr- Parameters:
list- list to which all used column expressions must be added- See Also:
-
hasSelectExpr
public boolean hasSelectExpr()returns whether or not the command has any select expression- Specified by:
hasSelectExprin classDBCommandExpr- Returns:
- true if the command has any select expression of false otherwise
-
hasSelectExpr
returns whether or not the command has a specific select expression- Specified by:
hasSelectExprin classDBCommandExpr- Parameters:
expr- the column expr- Returns:
- true if the command contains the given select expression of false otherwise
-
getSelectExpressions
Returns all select expressions as unmodifiable list- Specified by:
getSelectExpressionsin classDBCommandExpr- Returns:
- the list of DBColumnExpr used for select
-
getSelectExprList
Calls the method dbDBCommandExpr.getSelectExprList from the private variable 'left'. Returns a array of all DBColumnExpr object of the Vector: 'select'.- Specified by:
getSelectExprListin classDBCommandExpr- Returns:
- returns an array of all DBColumnExpr object of the Vector: 'select'
- See Also:
-
getParams
- Specified by:
getParamsin classDBCommandExpr
-
getParamValues
Returns the list of parameter values for a prepared statement. To ensure the correct order, getSelect() must be called first.- Specified by:
getParamValuesin classDBCommandExpr- Returns:
- the list of parameter values for a prepared statement
-
getDataType
Description copied from class:DBCommandExprReturns the DataType selected by this command if only one column is returned If the command has more than one select expression DataType.UNKNOWN will be returned- Specified by:
getDataTypein classDBCommandExpr- Returns:
- the DataType of the selected expression or DataType.UNKNOWN
-
getSelect
Creates the SQL-Command.- Specified by:
getSelectin classDBCommandExpr- Parameters:
sql- the SQL-Commandflags- bitwise context flags for sql building (see "Select Context Flags")
-
orderBy
Description copied from class:DBCommandExprAdds an order by expression the command- Overrides:
orderByin classDBCommandExpr- Parameters:
exprs- vararg of orderBy expressions- Returns:
- itself (this)
- See Also:
-