|
||||||||||
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.DBCommandExpr
public abstract class DBCommandExpr
This abstract class handles the creation of the SQL-Commands. There are inner classes to construct different SQL-Commands.
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 | |
---|---|
DBCommandExpr()
Constructs an empty DBCommandExpr object |
Method Summary | |
---|---|
void |
addSQL(java.lang.StringBuilder buf,
long context)
Creates the SQL-Command. |
void |
clearOrderBy()
Clears the list of order by expressions. |
DBColumnExpr |
getCmdColumn(DBColumnExpr col)
|
DBColumnExpr |
getCmdColumn(int i)
|
java.lang.String |
getInsertInto(DBTable table)
Create the insert into SQL-Command which copies data from a select statement to a destination table. |
java.lang.String |
getInsertInto(DBTable table,
java.util.List<DBColumnExpr> columns)
Create the insert into SQL-Command which copies data from a select statement to a destination table. |
java.lang.String |
getSelect()
returns an SQL select command for querying records. |
abstract boolean |
getSelect(java.lang.StringBuilder buf)
|
abstract DBColumnExpr[] |
getSelectExprList()
|
DBCommandExpr |
intersect(DBCommandExpr other)
Constructs a new DBCombinedCmd object with this object, the key word= "INTERSECT" and the selected DBCommandExpr. |
abstract boolean |
isValid()
|
void |
orderBy(DBColumnExpr expr)
This helper function calls the method orderBy(DBColumnExpr, boolean) and sets the second parameter to false,creates a new DBOrderByInfo object and adds it to the Vector 'orderBy'. |
void |
orderBy(DBColumnExpr expr,
boolean desc)
Creates a new DBOrderByInfo object and add it to the Vector 'orderBy'. |
DBCommandExpr |
union(DBCommandExpr other)
Constructs a new DBCombinedCmd object with this object, the key word= "UNION" and the selected DBCommandExpr. |
Methods inherited from class org.apache.empire.db.DBExpr |
---|
addReferencedColumns, getValueClass |
Methods inherited from class org.apache.empire.db.DBObject |
---|
getDatabase |
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 |
---|
public DBCommandExpr()
Method Detail |
---|
public abstract boolean isValid()
public abstract boolean getSelect(java.lang.StringBuilder buf)
public abstract DBColumnExpr[] getSelectExprList()
public DBColumnExpr getCmdColumn(DBColumnExpr col)
public DBColumnExpr getCmdColumn(int i)
public java.lang.String getSelect()
public void addSQL(java.lang.StringBuilder buf, long context)
addSQL
in class DBExpr
buf
- the SQL-Commandcontext
- the current SQL-Command contextpublic DBCommandExpr union(DBCommandExpr other)
other
- the secend DBCommandExpr
DBCombinedCmd
public DBCommandExpr intersect(DBCommandExpr other)
other
- the secend DBCommandExpr
public void clearOrderBy()
public void orderBy(DBColumnExpr expr, boolean desc)
expr
- the DBColumnExpr objectdesc
- if true, the results from select statement will sort top downpublic void orderBy(DBColumnExpr expr)
orderBy(DBColumnExpr, boolean)
public final java.lang.String getInsertInto(DBTable table, java.util.List<DBColumnExpr> columns)
public final java.lang.String getInsertInto(DBTable table)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |