Class DBCompareColExpr

All Implemented Interfaces:
DBPreparable

public class DBCompareColExpr extends DBCompareExpr
  • Field Details

    • expr

      protected final DBColumnExpr expr
    • cmpop

      protected final DBCmpType cmpop
    • value

      protected Object value
    • parenthesis

      protected boolean parenthesis
    • function

      protected DBFuncExpr function
  • Constructor Details

    • DBCompareColExpr

      public DBCompareColExpr(DBColumnExpr expr, DBCmpType op, Object value)
      Constructs a DBCompareColExpr object set the specified parameters to this object.
      Parameters:
      expr - the DBColumnExpr object
      op - the comparative context e.g. (CMP_EQUAL, CMP_SMALLER)
      value - the comparative value
  • Method Details

    • getDatabase

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

      public DBRowSet getRowSet()
      Returns the underlying rowset containing this column
      Specified by:
      getRowSet in class DBCompareExpr
      Returns:
      a column used for this expression
    • getColumnExpr

      public DBColumnExpr getColumnExpr()
      Gets the DBColumnExpr object
      Returns:
      the DBColumnExpr object
    • getCmpOperator

      public DBCmpType getCmpOperator()
      Gets the comparison operator
      Returns:
      the comparison operator
    • getValue

      public Object getValue()
      Gets the value to compare the column expression with
      Returns:
      the value to compare the column expression with
    • setValue

      public void setValue(Object value)
      The value to compare the column expression with
      Parameters:
      value - the comparison value
    • parenthesis

      public DBCompareColExpr parenthesis()
      wraps the expression in Parenthesis
      Returns:
      the parenthesis expression
    • prepareParams

      public void prepareParams(DBCommand cmd, DBExpr parent)
      Description copied from interface: DBPreparable
      Prepares an expression for a query This function is called by DBCommand in order to add values as query parameters instead of being literally included in the sql statement Please Note: This function is internally called. Do not call yourself!
      Parameters:
      cmd - the command to which to add the parameters
      parent - the parent expression holding the value
    • copy

      public DBCompareExpr copy(DBCommand newCmd)
      Copy Command
      Specified by:
      copy in class DBCompareExpr
      Parameters:
      newCmd - the new command object
      Returns:
      the cloned compare expression
    • 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:
    • addCompareExpr

      public void addCompareExpr(DBSQLBuilder sql, long context)
      Add the comparison operator and value to the SQL-Command.
      Parameters:
      sql - the SQL-Command
      context - the comparative context e.g. (CMP_EQUAL, CMP_SMALLER)
    • addSQL

      public void addSQL(DBSQLBuilder sql, long context)
      Creates the SQL-Command.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the SQL-Command
      context - the current SQL-Command context
    • toString

      public String toString()
      For Debugging
      Overrides:
      toString in class Object
    • isMutuallyExclusive

      public boolean isMutuallyExclusive(DBCompareExpr other)
      Returns whether the constraint should replace another one or not.
      Specified by:
      isMutuallyExclusive in class DBCompareExpr
      Returns:
      true it the constraints are mutually exclusive or false otherwise
    • isConstraintOn

      public boolean isConstraintOn(DBColumnExpr colExpr)
      Returns whether the constraint is on the given column
      Specified by:
      isConstraintOn in class DBCompareExpr
      Returns:
      true it the constraint is on the given column or false otherwise