Package org.apache.empire.db.expr.join
Class DBCrossJoinExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.expr.join.DBJoinExpr
org.apache.empire.db.expr.join.DBCrossJoinExpr
- All Implemented Interfaces:
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 Summary
FieldsFields inherited from class org.apache.empire.db.expr.join.DBJoinExpr
typeFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionDBCrossJoinExpr(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.voidaddSQL(DBSQLBuilder sql, long context) Not allowed, this operation have to be done in the DBCommand object.Copy CommandbooleanCompares two DBJoinExpr objects.final DBDatabaseReturns the current DBDatabase object.returns the RowSet on the left of the joinReturns the left table name if the data type= JOIN_LEFT and returns the right table if the data type= JOIN_RIGHT.returns the RowSet on the right of the joinbooleanreturns true if this join is using the given column or false otherwisebooleanreturns true if this join is using the given table or view or false otherwisevoidprepareParams(DBCommand cmd, DBExpr parent) 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.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.expr.join.DBJoinExpr
getTypeMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Field Details
-
left
-
right
-
-
Constructor Details
-
DBCrossJoinExpr
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 valueright- right value
-
-
Method Details
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
getLeftTable
returns the RowSet on the left of the join- Specified by:
getLeftTablein classDBJoinExpr- Returns:
- the rowset on the left
-
getRightTable
returns the RowSet on the right of the join- Specified by:
getRightTablein classDBJoinExpr- Returns:
- the rowset on the right
-
isJoinOn
returns true if this join is using the given table or view or false otherwise- Specified by:
isJoinOnin classDBJoinExpr- 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- Specified by:
isJoinOnin classDBJoinExpr- 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.- Specified by:
getOuterTablein classDBJoinExpr- Returns:
- the current DBDatabase object
-
setType
alters the join type for this join- Overrides:
setTypein classDBJoinExpr- Parameters:
type- the join type
-
reverse
public void reverse()This function swaps the left and the right statements of the join expression.- Specified by:
reversein classDBJoinExpr
-
prepareParams
Description copied from interface:DBPreparablePrepares 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 parametersparent- the parent expression holding the value
-
copy
Copy Command- Specified by:
copyin classDBJoinExpr- Parameters:
newCmd- the new command object- Returns:
- the join expression
-
addReferencedColumns
Description copied from class:DBExprInternal function to obtain all DBColumnExpr-objects used by this expression.- Specified by:
addReferencedColumnsin classDBExpr- Parameters:
list- list to which all used column expressions must be added- See Also:
-
addSQL
Not allowed, this operation have to be done in the DBCommand object. -
equals
Compares two DBJoinExpr objects.
-