public class TJoinExpr extends TNodeWithAliasClause implements IRelation
TJoin
as of version 2.7.4.0.
A JOIN expression consists of:
getLeftTable()
)
getRightTable()
)
getJointype()
) - e.g. INNER, LEFT, RIGHT, FULL, CROSS
getOnCondition()
)
getUsingColumns()
)
For nested joins, the left and right operands can themselves be JOIN expressions,
allowing representation of complex join trees. Use getLeftMostJoinExpr()
to
traverse to the leftmost join in a nested structure.
PostgreSQL-specific: Supports USING clause aliases via getJoin_using_alias()
.
The class implements IRelation
and maintains a list of available attributes
from both sides of the join via getAttributes()
.
Represents join table in parse tree.
Modifier and Type | Field and Description |
---|---|
TExpression |
onCondition
on condition;
|
EJoinType |
original_jontype |
TObjectNameList |
usingColumns
using (column list)
|
dbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken
Constructor and Description |
---|
TJoinExpr() |
Modifier and Type | Method and Description |
---|---|
void |
accept(TParseTreeVisitor v)
Accept a visitor
|
void |
acceptChildren(TParseTreeVisitor v)
Accept a visitor to iterate this class and sub-nodes of this class
|
ArrayList<TAttributeNode> |
getAttributes()
每个 relation 包含的 attributes
当它为 base table 时,这些 attributes 的来源有三种可能
1.
|
TAliasClause |
getJoin_using_alias()
Postgres: USING ( join_column [, ...] ) [ AS join_using_alias ]
|
EJoinType |
getJointype() |
TJoinExpr |
getLeftMostJoinExpr() |
TFromTable |
getLeftOperand()
This method is used by parser, do not use it in your code.
|
TTable |
getLeftTable() |
TExpression |
getMatchCondition() |
int |
getNestedParen() |
TExpression |
getOnCondition() |
String |
getRelationName() |
TFromTable |
getRightOperand()
This method is used by parser, do not use it in your code.
|
TTable |
getRightTable() |
TObjectNameList |
getUsingColumns() |
void |
incNestedParen() |
void |
init(Object arg1)
Initialize a query tree node.
|
void |
init(Object arg1,
Object arg2) |
void |
initAttributes(int roundNo) |
void |
setJoinCondition(TDummy pDummy) |
void |
setJoinCondition(TExpression onCondition) |
void |
setJointype(EJoinType jointype) |
void |
setLeftOperand(TFromTable leftOperand)
This method is used by parser, do not use it in your code.
|
void |
setLeftTable(TTable leftTable) |
void |
setMatchCondition(TExpression matchCondition) |
void |
setNestedParen(int nestedParen) |
void |
setOnCondition(TExpression onCondition) |
void |
setRightOperand(TFromTable rightOperand)
This method is used by parser, do not use it in your code.
|
void |
setRightTable(TTable rightTable) |
void |
setUsingColumns(TObjectNameList usingColumns) |
int |
size() |
getAliasClause, setAliasClause, toString
addAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, doAppendNewNode, doParse, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getParentObjectName, getPlainText, getStartToken, getTokenCount, hasNext, init, init, init, init, insertAfterAToken, insertNewNodeBeforeMe, isChanged, isTokensInChain, next, refreshAllNodesTokenCount, remove, removeAllMyTokensFromTokenList, removeTokens, removeTokensBetweenNodes, removeTokensBetweenToken, replaceWithNewNode, resetIterator, setAnchorNode, setChanged, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setEndToken, setEndTokenDirectly, setEvaluateDatatype, setEvalValue, setGsqlparser, setIncludingComment, setLocation, setNewSubNode, setNodeStatus, setNodeType, setParent, setPlainText, setStartToken, setStartToken, setStartToken, setStartToken, setStartTokenDirectly, setString, setString2, subNodeInNode, toScript, toString2
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEachRemaining
public TObjectNameList usingColumns
public TExpression onCondition
public EJoinType original_jontype
public TJoinExpr()
public TAliasClause getJoin_using_alias()
public void initAttributes(int roundNo)
public ArrayList<TAttributeNode> getAttributes()
IRelation
getAttributes
in interface IRelation
public String getRelationName()
getRelationName
in interface IRelation
public void setLeftTable(TTable leftTable)
public void setRightTable(TTable rightTable)
public TTable getLeftTable()
public TTable getRightTable()
public void incNestedParen()
public int getNestedParen()
public TObjectNameList getUsingColumns()
public TExpression getOnCondition()
public EJoinType getJointype()
public void setJointype(EJoinType jointype)
public TFromTable getLeftOperand()
public TFromTable getRightOperand()
public void setLeftOperand(TFromTable leftOperand)
public void setRightOperand(TFromTable rightOperand)
public void init(Object arg1)
TParseTreeNode
init
in class TParseTreeNode
arg1
- first argumentpublic void init(Object arg1, Object arg2)
init
in class TParseTreeNode
public void setJoinCondition(TDummy pDummy)
public void setJoinCondition(TExpression onCondition)
public TJoinExpr getLeftMostJoinExpr()
public void setNestedParen(int nestedParen)
public void setUsingColumns(TObjectNameList usingColumns)
public void setOnCondition(TExpression onCondition)
public TExpression getMatchCondition()
public void setMatchCondition(TExpression matchCondition)
public void accept(TParseTreeVisitor v)
TParseTreeNode
accept
in interface Visitable
accept
in class TParseTreeNode
v
- visitor is a descendant class of TParseTreeVisitor
public void acceptChildren(TParseTreeVisitor v)
TParseTreeNode
acceptChildren
in interface Visitable
acceptChildren
in class TParseTreeNode
v
- visitor is a descendant class of TParseTreeVisitor