org.apache.empire.db.oracle
Class DBCommandOracle

java.lang.Object
  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.DBCommand
                  extended by org.apache.empire.db.oracle.DBCommandOracle
All Implemented Interfaces:
Serializable, Cloneable

public class DBCommandOracle
extends DBCommand

This class handles the special features of an oracle database.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.empire.db.DBCommandExpr
DBCommandExpr.DBCmdColumn, DBCommandExpr.DBCmdQuery
 
Field Summary
protected  DBCompareExpr connectBy
           
protected  String optimizerHint
           
protected  OracleRowNumExpr rowNumExpr
           
protected  DBCompareExpr startWith
           
 
Fields inherited from class org.apache.empire.db.DBCommand
cmdParams, groupBy, having, joins, log, select, selectDistinct, set, where
 
Fields inherited from class org.apache.empire.db.DBCommandExpr
cmdQuery, orderBy
 
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
DBCommandOracle(DBDatabase db)
          Constructs an oracle command object.
 
Method Summary
 void clear()
          Clears the entire command object.
 void clearConnectBy()
          Clears the connectBy Expression.
 void clearLimit()
          Clears a limit or offset set by calling limit() or offset()
 void connectByPrior(DBCompareExpr expr)
           
 String getDelete(DBTable table)
          Creates an Oracle specific delete statement.
 String getOptimizerHint()
           
 void getSelect(StringBuilder buf)
          Creates an Oracle specific select statement that supports special features of the Oracle DBMS like e.g.
protected  String getSimpleUpdate()
           
 String getUpdate()
          Creates an Oracle specific update statement.
protected  String getUpdateWithJoins()
           
 void limitRows(int numRows)
          set the maximum number of rows to return when executing a query command A negative value will remove the limit.
 void setOptimizerHint(String optimizerHint)
           
 void setOptimizerIndexHint(DBIndex index)
           
 void startWith(DBCompareExpr expr)
           
 
Methods inherited from class org.apache.empire.db.DBCommand
addFrom, addGrouping, addJoins, addOrder, addParam, addParam, addParam, addParam, addReferencedColumns, addSelect, addWhere, addWhere, addWhereConstraints, clearGroupBy, clearHaving, clearJoin, clearSelect, clearSelectDistinct, clearSet, clearWhere, clone, getDatabase, getInsert, getJoins, getParamValues, getSelectExprList, getTableList, getWhereConstraints, groupBy, hasJoinOn, hasJoinOn, hasSelectExpr, hasSetExprOn, hasWhereConstraints, having, isSelectDistinct, isValid, isValidQuery, isValidUpdate, join, join, join, join, join, notifyParamUsage, removeConstraintOn, removeHavingConstraintOn, removeJoinsOn, removeJoinsOn, removeWhereConstraintOn, resetParamUsage, select, select, select, selectDistinct, set, setConstraint, useCmdParam, where
 
Methods inherited from class org.apache.empire.db.DBCommandExpr
addListExpr, addSQL, clearOrderBy, getCmdColumn, getInsertInto, getInsertInto, getInsertInto, getSelect, intersect, orderBy, orderBy, orderBy, skipRows, union
 
Methods inherited from class org.apache.empire.db.DBExpr
getObjectValue, getValueClass
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectBy

protected DBCompareExpr connectBy

startWith

protected DBCompareExpr startWith

optimizerHint

protected String optimizerHint

rowNumExpr

protected OracleRowNumExpr rowNumExpr
Constructor Detail

DBCommandOracle

public DBCommandOracle(DBDatabase db)
Constructs an oracle command object.

Parameters:
db - the oracle database object this command belongs to
See Also:
DBCommand
Method Detail

getOptimizerHint

public String getOptimizerHint()

setOptimizerHint

public void setOptimizerHint(String optimizerHint)

setOptimizerIndexHint

public void setOptimizerIndexHint(DBIndex index)

clear

public void clear()
Description copied from class: DBCommand
Clears the entire command object.

Overrides:
clear in class DBCommand
See Also:
DBCommand.clear()

clearConnectBy

public void clearConnectBy()
Clears the connectBy Expression.


connectByPrior

public void connectByPrior(DBCompareExpr expr)

startWith

public void startWith(DBCompareExpr expr)

limitRows

public void limitRows(int numRows)
Description copied from class: DBCommandExpr
set the maximum number of rows to return when executing a query command A negative value will remove the limit.

Overrides:
limitRows in class DBCommandExpr

clearLimit

public void clearLimit()
Description copied from class: DBCommandExpr
Clears a limit or offset set by calling limit() or offset()

Overrides:
clearLimit in class DBCommandExpr

getSelect

public void getSelect(StringBuilder buf)
Creates an Oracle specific select statement that supports special features of the Oracle DBMS like e.g. CONNECT BY PRIOR

Overrides:
getSelect in class DBCommand
Parameters:
buf - the SQL statement

getUpdate

public String getUpdate()
Creates an Oracle specific update statement. If a join is required, this method creates a "MERGE INTO" expression

Overrides:
getUpdate in class DBCommand
Returns:
the update SQL-Command

getSimpleUpdate

protected String getSimpleUpdate()

getUpdateWithJoins

protected String getUpdateWithJoins()

getDelete

public String getDelete(DBTable table)
Creates an Oracle specific delete statement.

Overrides:
getDelete in class DBCommand
Parameters:
table - the table object
Returns:
the delete SQL-Command


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.