Class DBExistsExpr

All Implemented Interfaces:
DBPreparable

public class DBExistsExpr extends DBCompareExpr
This class is used for building up the SQL-Command for the EXISTS syntax.
  • Field Details

  • Constructor Details

    • DBExistsExpr

      public DBExistsExpr(DBCommandExpr cmd)
      Constructs a DBExistsExpr object set the specified parameters to this object.
      Parameters:
      cmd - the DBCommandExpr object
    • DBExistsExpr

      public DBExistsExpr(DBCommandExpr cmd, DBCompareExpr compareExpr)
      Constructs a DBExistsExpr object set the specified parameters to this object.
      Parameters:
      cmd - the DBCommandExpr object
      compareExpr - The expression to append to the end of the exists statement
  • 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
    • 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.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the SQL-Command
      context - the current SQL-Command context (CTX_DEFAULT, CTX_SELECT, CTX_NAME, CTX_VALUE)
    • isMutuallyExclusive

      public boolean isMutuallyExclusive(DBCompareExpr other)
      Returns wheter 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