Class DBCompareAndOrExpr

All Implemented Interfaces:
DBPreparable

public class DBCompareAndOrExpr extends DBCompareExpr
This class is used for combining two filter constraints by and / or operator

There is no need to explicitly create instances of this class.
Instead use DBCompareExpr.and(DBCompareExpr) or DBCompareExpr.or(DBCompareExpr)

  • Field Details

  • Constructor Details

    • DBCompareAndOrExpr

      public DBCompareAndOrExpr(DBCompareExpr left, DBCompareExpr right, boolean or)
      Constructs a DBCompareColExpr object
      Parameters:
      left - the left side of the expression
      right - the right side of the expression
      or - true for OR operation, false for AND
  • Method Details

    • getLeft

      public DBCompareExpr getLeft()
    • getRight

      public DBCompareExpr getRight()
    • isOr

      public boolean isOr()
    • 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
    • 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:
    • addSQL

      public void addSQL(DBSQLBuilder sql, long context)
      Creates the SQL-Command sets the specified compare value (the varible boolOP) between the two DBCompareExpr objects.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the SQL statment
      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
    • parenthesis

      public DBCompareExpr parenthesis()
      wraps the current expression with parenthesis.
      Returns:
      the new DBCompareColExpr object