Class DBCombinedCmd


public class DBCombinedCmd extends DBCommandExpr
This class is used for combining two DBCommandExpr objects to a new single DBCommandExpr This may be used to create "UNION" or "INTERSECT" queries
  • Field Details

  • Constructor Details

    • DBCombinedCmd

      public DBCombinedCmd(DBCommandExpr left, 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 two DBCommandExpr objects
      right - the second DBCommandExpr object
  • Method Details

    • createSQLBuilder

      protected DBSQLBuilder createSQLBuilder(String initalSQL)
      Description copied from class: DBCommandExpr
      creates a new DBSQLBuilder
      Overrides:
      createSQLBuilder in class DBCommandExpr
      Parameters:
      initalSQL - the initial sql fragment
      Returns:
      the new DBSQLBuilder
    • isValid

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

      public final DBDatabase getDatabase()
      Returns the current DBDatabase object.
      Specified by:
      getDatabase in class DBObject
      Returns:
      the current DBDatabase object
    • addReferencedColumns

      public void addReferencedColumns(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:
    • hasSelectExpr

      public boolean hasSelectExpr()
      returns whether or not the command has any select expression
      Specified by:
      hasSelectExpr in class DBCommandExpr
      Returns:
      true if the command has any select expression of false otherwise
    • hasSelectExpr

      public boolean hasSelectExpr(DBColumnExpr expr)
      returns whether or not the command has a specific select expression
      Specified by:
      hasSelectExpr in class DBCommandExpr
      Parameters:
      expr - the column expr
      Returns:
      true if the command contains the given select expression of false otherwise
    • getSelectExpressions

      public List<DBColumnExpr> getSelectExpressions()
      Returns all select expressions as unmodifiable list
      Specified by:
      getSelectExpressions in class DBCommandExpr
      Returns:
      the list of DBColumnExpr used for select
    • 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:
    • getParams

      public DBCmdParams getParams()
      Specified by:
      getParams in class DBCommandExpr
    • getParamValues

      public Object[] getParamValues()
      Returns the list of parameter values for a prepared statement. To ensure the correct order, getSelect() must be called first.
      Specified by:
      getParamValues in class DBCommandExpr
      Returns:
      the list of parameter values for a prepared statement
    • getDataType

      public DataType getDataType()
      Description copied from class: DBCommandExpr
      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 returned
      Specified by:
      getDataType in class DBCommandExpr
      Returns:
      the DataType of the selected expression or DataType.UNKNOWN
    • getSelect

      public void getSelect(DBSQLBuilder sql, int flags)
      Creates the SQL-Command.
      Specified by:
      getSelect in class DBCommandExpr
      Parameters:
      sql - the SQL-Command
      flags - bitwise context flags for sql building (see "Select Context Flags")
    • orderBy

      public DBCommandExpr orderBy(DBOrderByExpr... exprs)
      Description copied from class: DBCommandExpr
      Adds an order by expression the command
      Overrides:
      orderBy in class DBCommandExpr
      Parameters:
      exprs - vararg of orderBy expressions
      Returns:
      itself (this)
      See Also: