Package org.apache.empire.db.expr.join
Class DBJoinExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.expr.join.DBJoinExpr
- All Implemented Interfaces:
DBPreparable
- Direct Known Subclasses:
DBColumnJoinExpr,DBCrossJoinExpr
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 Summary
FieldsFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDBJoinExpr(DBJoinType type) Constructs a new DBJoinExpr object initialize this object with the left and right column and the data type of the join expression. -
Method Summary
Modifier and TypeMethodDescriptionabstract DBJoinExprCopy Commandabstract DBRowSetreturns the RowSet on the left of the joinabstract DBRowSetReturns the left table name if the data type= JOIN_LEFT and returns the right table if the data type= JOIN_RIGHT.abstract DBRowSetreturns the RowSet on the right of the joingetType()returns the join type for this joinabstract booleanreturns true if this join is using the given column or false otherwiseabstract booleanreturns true if this join is using the given table or view or false otherwiseabstract voidreverse()This function swaps the left and the right statements of the join expression.voidsetType(DBJoinType type) alters the join type for this joinMethods inherited from class org.apache.empire.db.DBExpr
addReferencedColumns, addSQLMethods inherited from class org.apache.empire.db.DBObject
checkParamNull, getDatabaseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.empire.db.expr.column.DBPreparable
prepareParams
-
Field Details
-
type
-
-
Constructor Details
-
DBJoinExpr
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
returns the join type for this join- Returns:
- the join type
-
setType
alters the join type for this join- Parameters:
type- the join type
-
getLeftTable
returns the RowSet on the left of the join- Returns:
- the rowset on the left
-
getRightTable
returns the RowSet on the right of the join- Returns:
- the rowset on the right
-
isJoinOn
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
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
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
Copy Command- Parameters:
newCmd- the new command object- Returns:
- the join expression
-