|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.commons.ErrorObject
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.expr.join.DBJoinExpr
public class 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.
Instead use @link DBCommand.join(DBColumnExpr, DBColumn, DBJoinType)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.empire.commons.ErrorObject |
---|
ErrorObject.ObjectErrorInfo |
Field Summary | |
---|---|
DBCompareExpr |
compExpr
|
protected DBColumnExpr |
left
|
protected DBColumnExpr |
right
|
protected DBJoinType |
type
|
Fields inherited from class org.apache.empire.db.DBExpr |
---|
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUE, log |
Constructor Summary | |
---|---|
DBJoinExpr(DBColumnExpr left,
DBColumnExpr right,
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 | |
---|---|
void |
addReferencedColumns(java.util.Set<DBColumn> list)
Internal function to obtain all DBColumnExpr-objects used by this expression. |
void |
addSQL(java.lang.StringBuilder buf,
long context)
Not allowed, this operation have to be done in the DBCommand object. |
DBCompareExpr |
and(DBColumnExpr c1,
DBColumnExpr c2)
This function adds an additional constraint to the join. |
boolean |
equals(java.lang.Object obj)
Compares two DBJoinExpr objects. |
DBDatabase |
getDatabase()
Returns the current DBDatabase object. |
DBColumnExpr |
getLeft()
|
DBRowSet |
getOuterTable()
Returns the left table name if the data type= JOIN_LEFT and returns the right table if the data type= JOIN_RIGHT. |
DBColumnExpr |
getRight()
|
DBJoinType |
getType()
|
boolean |
isJoinOn(DBRowSet rowset)
|
void |
reverse()
This function swaps the left and the right statements of the join expression. |
void |
where(DBCompareExpr expr)
This function adds an additional constraint to the join. |
Methods inherited from class org.apache.empire.db.DBExpr |
---|
getObjectValue, getValueClass |
Methods inherited from class org.apache.empire.db.DBObject |
---|
error, error |
Methods inherited from class org.apache.empire.commons.ErrorObject |
---|
clearError, clearErrorInfo, error, error, error, error, error, error, error, getErrorInfo, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, internalSetError, isExceptionsEnabled, setExceptionsEnabled, success |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DBColumnExpr left
protected DBColumnExpr right
protected DBJoinType type
public DBCompareExpr compExpr
Constructor Detail |
---|
public DBJoinExpr(DBColumnExpr left, DBColumnExpr right, DBJoinType type)
left
- left valueright
- right valuetype
- data type (JOIN_INNER, JOIN_LEFT or JOIN_RIGHT)Method Detail |
---|
public DBDatabase getDatabase()
getDatabase
in class DBObject
public DBColumnExpr getLeft()
public DBColumnExpr getRight()
public DBJoinType getType()
public boolean isJoinOn(DBRowSet rowset)
public DBRowSet getOuterTable()
public void reverse()
public void where(DBCompareExpr expr)
expr
- the compare expressionpublic DBCompareExpr and(DBColumnExpr c1, DBColumnExpr c2)
c1
- the first columnc2
- the second column
public void addReferencedColumns(java.util.Set<DBColumn> list)
DBExpr
addReferencedColumns
in class DBExpr
list
- list to which all used column expressions must be addedDBExpr.addReferencedColumns(Set)
public void addSQL(java.lang.StringBuilder buf, long context)
addSQL
in class DBExpr
buf
- the string buffer used to build the sql commandcontext
- context flag for this SQL-Command (see CTX_??? constants).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- other DBJoinExpr object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |