Package com.exasol.sql.dql.select
Class FromClause
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.dql.select.FromClause
-
- All Implemented Interfaces:
SelectFragment,Fragment
public class FromClause extends AbstractFragment implements SelectFragment
This class represents theFROMclause of an SQLSELECTstatement.
-
-
Field Summary
-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Constructor Description FromClause(Fragment root)Create a new instance of aFromClause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SelectVisitor visitor)Accept a visitor (e.g.FromClausefullJoin(String name, String specification)Create a new fullJointhat belongs to aFROMclause.FromClausefullOuterJoin(String name, String specification)Create a new full outerJointhat belongs to aFROMclause.booleanhasSubSelect()Check if theFromClausecontains a sub-select statement.FromClauseinnerJoin(String name, String specification)Create a new innerJointhat belongs to aFROMclause.FromClausejoin(String name, String specification)Create a newJointhat belongs to aFROMclause.FromClauseleftJoin(String name, String specification)Create a new leftJointhat belongs to aFROMclause.FromClauseleftOuterJoin(String name, String specification)Create a new left outerJointhat belongs to aFROMclause.FromClauserightJoin(String name, String specification)Create a new rightJointhat belongs to aFROMclause.FromClauserightOuterJoin(String name, String specification)Create a new right outerJointhat belongs to aFROMclause.FromClauseselect(Select select)Add a select to theFromClause.FromClausetable(String name)Add a table name to theFromClause.FromClausetableAs(String name, String as)Add a table name with an alias to theFromClause.FromClausevalueTable(ValueTable valueTable)Create aFromClausefrom a value table.FromClausevalueTableAs(ValueTable valueTable, String tableNameAlias, String... columnNameAliases)Create aFromClausefrom a value table and an alias.-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Constructor Detail
-
FromClause
public FromClause(Fragment root)
Create a new instance of aFromClause.- Parameters:
root- root SQL statement thisFROMclause belongs to
-
-
Method Detail
-
table
public FromClause table(String name)
Add a table name to theFromClause.- Parameters:
name- table name- Returns:
FROMclause
-
tableAs
public FromClause tableAs(String name, String as)
Add a table name with an alias to theFromClause.- Parameters:
name- table nameas- table alias- Returns:
- parent
FROMclause
-
valueTable
public FromClause valueTable(ValueTable valueTable)
Create aFromClausefrom a value table.- Parameters:
valueTable- table of value expressions- Returns:
- parent
FROMclause
-
valueTableAs
public FromClause valueTableAs(ValueTable valueTable, String tableNameAlias, String... columnNameAliases)
Create aFromClausefrom a value table and an alias.- Parameters:
valueTable- table of value expressionstableNameAlias- table aliascolumnNameAliases- columns aliases- Returns:
- parent
FROMclause
-
join
public FromClause join(String name, String specification)
Create a newJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
innerJoin
public FromClause innerJoin(String name, String specification)
Create a new innerJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
leftJoin
public FromClause leftJoin(String name, String specification)
Create a new leftJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
rightJoin
public FromClause rightJoin(String name, String specification)
Create a new rightJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
fullJoin
public FromClause fullJoin(String name, String specification)
Create a new fullJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
leftOuterJoin
public FromClause leftOuterJoin(String name, String specification)
Create a new left outerJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
rightOuterJoin
public FromClause rightOuterJoin(String name, String specification)
Create a new right outerJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
fullOuterJoin
public FromClause fullOuterJoin(String name, String specification)
Create a new full outerJointhat belongs to aFROMclause.- Parameters:
name- name of the table to be joinedspecification- join conditions- Returns:
- parent
FROMclause
-
select
public FromClause select(Select select)
Add a select to theFromClause.- Parameters:
select-SELECTstatement- Returns:
FROMclause
-
hasSubSelect
public boolean hasSubSelect()
Check if theFromClausecontains a sub-select statement.- Returns:
- true if the
FromClausecontains a sub-select statement
-
accept
public void accept(SelectVisitor visitor)
Description copied from interface:SelectFragmentAccept a visitor (e.g. a renderer or validator)- Specified by:
acceptin interfaceSelectFragment- Parameters:
visitor- visitor to accept
-
-