Package org.apache.empire.db.expr.join
Class DBColumnJoinExpr
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.DBColumnJoinExpr
- All Implemented Interfaces:
DBPreparable
- Direct Known Subclasses:
DBCompareJoinExpr
-
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
ConstructorsConstructorDescriptionDBColumnJoinExpr(DBColumnExpr left, DBColumnExpr right, DBJoinType type) DBColumnJoinExpr(DBColumnExpr left, DBColumnExpr right, DBJoinType type, DBCompareExpr addlConstraint) Constructs a join expression based on two columns or column expressionsDBColumnJoinExpr(DBColumnJoinExpr joinExpr, DBCompareExpr addlConstraint) Copy and concat constructor -
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.and(DBColumnExpr c1, DBColumnExpr c2) This function adds an additional constraint to the join.and(DBCompareExpr expr) This function adds an additional constraint to the join.Copy CommandbooleanCompares two DBJoinExpr objects.final DBDatabaseReturns the current DBDatabase object.getLeft()returns the left join expressionreturns 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.getRight()returns the right join expressionreturns the RowSet on the right of the joingetWhere()Returns any additional constraints to 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.toString()For Debuggingvoidwhere(DBCompareExpr expr) This function adds an additional constraint to the join.Methods inherited from class org.apache.empire.db.expr.join.DBJoinExpr
getType, setTypeMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Field Details
-
left
-
right
-
compExpr
-
-
Constructor Details
-
DBColumnJoinExpr
public DBColumnJoinExpr(DBColumnExpr left, DBColumnExpr right, DBJoinType type, DBCompareExpr addlConstraint) Constructs a join expression based on two columns or column expressions- Parameters:
left- left valueright- right valuetype- data type (JOIN_INNER, JOIN_LEFT or JOIN_RIGHT)addlConstraint- additional constraint
-
DBColumnJoinExpr
-
DBColumnJoinExpr
Copy and concat constructor- Parameters:
joinExpr- the original joinExpraddlConstraint- additional constraint
-
-
Method Details
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
getLeft
returns the left join expression- Returns:
- the left column expression
-
getRight
returns the right join expression- Returns:
- the right column expression
-
getLeftTable
Description copied from class:DBJoinExprreturns 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
-
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
-
getWhere
Returns any additional constraints to the join- Returns:
- a compare expression containing additional constraints or null
-
where
This function adds an additional constraint to the join.- Parameters:
expr- the compare expression
-
and
This function adds an additional constraint to the join.- Parameters:
expr- the expression to add- Returns:
- the object itself
-
and
This function adds an additional constraint to the join.- Parameters:
c1- the first columnc2- the second column- Returns:
- the object itself
-
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. -
toString
For Debugging -
equals
Compares two DBJoinExpr objects.
-