gudusoft.gsqlparser.nodes
Class TJoinItem

java.lang.Object
  extended by gudusoft.gsqlparser.nodes.TParseTreeNode
      extended by gudusoft.gsqlparser.nodes.TJoinItem
All Implemented Interfaces:
Visitable

public class TJoinItem
extends TParseTreeNode

SQL 1:

 select f from t1 left join t2 on t1.f1 = t2.f1 right join t3 on t1.f1 = t3.f1
In above SQL, the whole from clause can be represented by a 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 Summary
TJoinItem()
           
 
Method Summary
 void accept(TParseTreeVisitor v)
           
 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)
           
 
Methods inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
addAllMyTokensToTokenList, doParse, getColumnNo, getDummyTag, getEndToken, getGsqlparser, getLineNo, getNodeType, getStartToken, init, init, init, init, init, init, setDummyTag, setEndToken, setEndToken, setGsqlparser, setNodeType, setStartToken, setStartToken, setString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TJoinItem

public TJoinItem()
Method Detail

getJoin

public TJoin getJoin()
Valid when getKind() = TBaseType.join_source_join, means this joinitem start with a join.


getJoinType

public EJoinType getJoinType()
Returns:
join type of this join, such as left join, right join.

getTable

public TTable getTable()
Valid when @getKind( = TBaseType.join_source_table, means this joinitem start with a table.

Returns:

setJoin

public void setJoin(TJoin join)

setKind

public void setKind(int kind)

getKind

public int getKind()
According to the table source in from clause, there are 2 kinds of joinitem.

Returns:

setTable

public void setTable(TTable table)

setUsingColumns

public void setUsingColumns(TObjectNameList usingColumns)

getUsingColumns

public TObjectNameList getUsingColumns()

setOnCondition

public void setOnCondition(TExpression onCondition)

getOnCondition

public TExpression getOnCondition()
Returns:
join condition, is type of TExpression.

setJoinType

public void setJoinType(EJoinType joinType)

accept

public void accept(TParseTreeVisitor v)
Specified by:
accept in interface Visitable
Overrides:
accept in class TParseTreeNode