Class DBJoinExpr

All Implemented Interfaces:
DBPreparable
Direct Known Subclasses:
DBColumnJoinExpr, DBCrossJoinExpr

public abstract class DBJoinExpr extends DBExpr implements DBPreparable
This class is used for building a join expression of an SQL statement. There is no need to explicitly create instances of this class.
  • Field Details

  • Constructor Details

    • DBJoinExpr

      protected DBJoinExpr(DBJoinType type)
      Constructs a new DBJoinExpr object initialize this object with the left and right column and the data type of the join expression.
      Parameters:
      type - the join type (JOIN_INNER, JOIN_LEFT or JOIN_RIGHT)
  • Method Details

    • getType

      public DBJoinType getType()
      returns the join type for this join
      Returns:
      the join type
    • setType

      public void setType(DBJoinType type)
      alters the join type for this join
      Parameters:
      type - the join type
    • getLeftTable

      public abstract DBRowSet getLeftTable()
      returns the RowSet on the left of the join
      Returns:
      the rowset on the left
    • getRightTable

      public abstract DBRowSet getRightTable()
      returns the RowSet on the right of the join
      Returns:
      the rowset on the right
    • isJoinOn

      public abstract boolean isJoinOn(DBRowSet rowset)
      returns true if this join is using the given table or view or false otherwise
      Parameters:
      rowset - the rowset to check
      Returns:
      true if the join is on the given rowset
    • isJoinOn

      public abstract boolean isJoinOn(DBColumn column)
      returns true if this join is using the given column or false otherwise
      Parameters:
      column - the column to check
      Returns:
      true if the join is on the given column
    • getOuterTable

      public abstract DBRowSet getOuterTable()
      Returns the left table name if the data type= JOIN_LEFT and returns the right table if the data type= JOIN_RIGHT. If the data type = JOIN_INNER the return value is null.
      Returns:
      the current DBDatabase object
    • reverse

      public abstract void reverse()
      This function swaps the left and the right statements of the join expression.
    • copy

      public abstract DBJoinExpr copy(DBCommand newCmd)
      Copy Command
      Parameters:
      newCmd - the new command object
      Returns:
      the join expression