Package com.mckoi.database.interpret
Class FromClause
java.lang.Object
com.mckoi.database.interpret.FromClause
- All Implemented Interfaces:
StatementTreeObject
,Serializable
,Cloneable
public final class FromClause
extends Object
implements Serializable, StatementTreeObject, Cloneable
A container for the From clause of a select statement. This handles
the different types of joins.
- Author:
- Tobias Downer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addJoin
(int type) Adds a Join to the from clause.void
addJoin
(int type, Expression on_expression) Adds a Join to the from clause.void
addPreviousJoin
(int type, Expression on_expression) Hack, add a joining type to the previous entry from the end.void
Adds a table name to this FROM clause.void
Adds a table name + alias to this FROM clause.void
addTableDeclaration
(String table_name, TableSelectExpression select, String table_alias) A generic form of a table declaration.Returns a Set of FromTableDef objects that represent all the tables that are in this from clause.clone()
Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members.Returns the JoiningSet object for the FROM clause.int
getJoinType
(int n) Returns the type of join after table 'n' in the set of tables in the from clause.getOnExpression
(int n) Returns the ON Expression for the type of join after table 'n' in the set.void
prepareExpressions
(ExpressionPreparer preparer) Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.
-
Constructor Details
-
FromClause
public FromClause()
-
-
Method Details
-
addTable
Adds a table name to this FROM clause. Note that the given name may be a dot deliminated ref such as (schema.table_name). -
addTable
Adds a table name + alias to this FROM clause. -
addTableDeclaration
public void addTableDeclaration(String table_name, TableSelectExpression select, String table_alias) A generic form of a table declaration. If any parameters are 'null' it means the information is not available. -
addJoin
public void addJoin(int type) Adds a Join to the from clause. 'type' must be a join type as defined in JoiningSet. -
addPreviousJoin
Hack, add a joining type to the previous entry from the end. This is an artifact of how joins are parsed. -
addJoin
Adds a Join to the from clause. 'type' must be a join type as defined in JoiningSet, and expression represents the ON condition. -
getJoinSet
Returns the JoiningSet object for the FROM clause. -
getJoinType
public int getJoinType(int n) Returns the type of join after table 'n' in the set of tables in the from clause. Returns, JoiningSet.INNER_JOIN, JoiningSet.FULL_OUTER_JOIN, etc. -
getOnExpression
Returns the ON Expression for the type of join after table 'n' in the set. -
allTables
Returns a Set of FromTableDef objects that represent all the tables that are in this from clause. -
prepareExpressions
Description copied from interface:StatementTreeObject
Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.- Specified by:
prepareExpressions
in interfaceStatementTreeObject
- Throws:
DatabaseException
-
clone
Description copied from interface:StatementTreeObject
Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members. If the object is immutable then it may return 'this'.- Specified by:
clone
in interfaceStatementTreeObject
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-