public class TJoinItem extends TParseTreeNode
SQL 1:
In above SQL, the whole from clause can be represented by aselect f from t1 left join t2 on t1.f1 = t2.f1 right join t3 on t1.f1 = t3.f1
TJoin
class.
And "left join t2 on t1.f1 = t2.f1 right join t3 on t1.f1 = t3.f1" was represented by 2 instance of class TJoinItem
.
These 2 instance can be accessed via TJoin.getJoinItems()
.
One for: "left join t2 on t1.f1 = t2.f1", the other is "right join t3 on t1.f1 = t3.f1".
Constructor and Description |
---|
TJoinItem() |
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
|
TJoin |
getJoin()
Valid when
getKind() = TBaseType.join_source_join , means this joinitem start with a join. |
EJoinType |
getJoinType() |
int |
getKind()
According to the table source in from clause, there are 2 kinds of joinitem.
|
TExpression |
getOnCondition() |
TTable |
getTable()
Valid when
@getKind( = TBaseType.join_source_table , means this joinitem start with a table. |
TObjectNameList |
getUsingColumns() |
void |
setJoin(TJoin join) |
void |
setJoinType(EJoinType joinType) |
void |
setKind(int kind) |
void |
setOnCondition(TExpression onCondition) |
void |
setTable(TTable table) |
void |
setUsingColumns(TObjectNameList usingColumns) |
addAllMyTokensToTokenList, appendString, doParse, fastSetString, getColumnNo, getDummyTag, getEndToken, getGsqlparser, getLineNo, getNodeType, getStartToken, init, init, init, init, init, init, removeAllMyTokensFromTokenList, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setGsqlparser, setIncludingComment, setNodeType, setStartToken, setStartToken, setStartToken, setStartToken, setString, toScript, toString
public TJoin getJoin()
getKind()
= TBaseType.join_source_join
, means this joinitem start with a join.public EJoinType getJoinType()
public TTable getTable()
@getKind(
= TBaseType.join_source_table
, means this joinitem start with a table.public void setJoin(TJoin join)
public void setKind(int kind)
public int getKind()
TBaseType.join_source_table
means this joinitem start with a table.
select f from t1 join t2 on t1.f1 = t2.f1
Text representation of this class is: "join t2 on t1.f1 = t2.f1"
"t2" can be fetch from getTable()
.
TBaseType.join_source_join
means this joinitem start with a join.
select f1 from a join (c join c1 on c.f1 = c1.f1) c2 on a.f1=c2.f1
Text representation of this class is: "join (c join c1 on c.f1 = c1.f1) c2 on a.f1=c2.f1"
"(c join c1 on c.f1 = c1.f1)" can be fetched from getJoin()
.
public void setTable(TTable table)
public void setUsingColumns(TObjectNameList usingColumns)
public TObjectNameList getUsingColumns()
public void setOnCondition(TExpression onCondition)
public TExpression getOnCondition()
TExpression
.public void setJoinType(EJoinType joinType)
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
Copyright © 2019. All rights reserved.