Class DBCrossJoinExpr

All Implemented Interfaces:
DBPreparable

public class DBCrossJoinExpr extends DBJoinExpr
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

    • DBCrossJoinExpr

      public DBCrossJoinExpr(DBRowSet left, DBRowSet right)
      Constructs a new DBJoinExpr object initialize this object with the left and right column and the data type of the join expression.
      Parameters:
      left - left value
      right - right value
  • Method Details

    • getDatabase

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

      public DBRowSet getLeftTable()
      returns the RowSet on the left of the join
      Specified by:
      getLeftTable in class DBJoinExpr
      Returns:
      the rowset on the left
    • getRightTable

      public DBRowSet getRightTable()
      returns the RowSet on the right of the join
      Specified by:
      getRightTable in class DBJoinExpr
      Returns:
      the rowset on the right
    • isJoinOn

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

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

      public 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.
      Specified by:
      getOuterTable in class DBJoinExpr
      Returns:
      the current DBDatabase object
    • setType

      public void setType(DBJoinType type)
      alters the join type for this join
      Overrides:
      setType in class DBJoinExpr
      Parameters:
      type - the join type
    • reverse

      public void reverse()
      This function swaps the left and the right statements of the join expression.
      Specified by:
      reverse in class DBJoinExpr
    • 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 DBJoinExpr copy(DBCommand newCmd)
      Copy Command
      Specified by:
      copy in class DBJoinExpr
      Parameters:
      newCmd - the new command object
      Returns:
      the join 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)
      Not allowed, this operation have to be done in the DBCommand object.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the string buffer used to build the sql command
      context - context flag for this SQL-Command (see CTX_??? constants).
    • equals

      public boolean equals(Object obj)
      Compares two DBJoinExpr objects.
      Overrides:
      equals in class Object
      Parameters:
      obj - other DBJoinExpr object
      Returns:
      true if the other DBJoinExpr object is equal to this object