Package com.mckoi.database.interpret
Class TableSelectExpression
- java.lang.Object
-
- com.mckoi.database.interpret.TableSelectExpression
-
- All Implemented Interfaces:
StatementTreeObject,java.io.Serializable,java.lang.Cloneable
public final class TableSelectExpression extends java.lang.Object implements java.io.Serializable, StatementTreeObject, java.lang.Cloneable
A container object for the a table select expression, eg.SELECT [columns] FROM [tables] WHERE [search_clause] GROUP BY [column] HAVING [search_clause] [composite_function] [table_select_expression]Note that a TableSelectExpression can be nested in the various clauses of this object.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayListcolumnsThe list of columns to select from.(package private) intcomposite_functionIf there is a composite function this is set to the composite enumeration from CompositeTable.booleandistinctTrue if we only search for distinct elements.FromClausefrom_clauseThe from clause.java.util.ArrayListgroup_byThe list of columns to group by.Variablegroup_maxThe group max variable or null if no group max.SearchExpressionhaving_clauseThe having clause.(package private) booleanis_composite_allIf this is an ALL composite (no removal of duplicate rows) it is true.(package private) TableSelectExpressionnext_compositeThe composite table itself.(package private) static longserialVersionUIDSearchExpressionwhere_clauseThe where clause.
-
Constructor Summary
Constructors Constructor Description TableSelectExpression()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchainComposite(TableSelectExpression expression, java.lang.String composite, boolean is_all)Chains a new composite function to this expression.java.lang.Objectclone()Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members.private static voidprepareAllInList(java.util.List list, ExpressionPreparer preparer)Prepares all the expressions in the list.voidprepareExpressions(ExpressionPreparer preparer)Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
distinct
public boolean distinct
True if we only search for distinct elements.
-
columns
public java.util.ArrayList columns
The list of columns to select from. (SelectColumn)
-
from_clause
public FromClause from_clause
The from clause.
-
where_clause
public SearchExpression where_clause
The where clause.
-
group_by
public java.util.ArrayList group_by
The list of columns to group by. (ByColumn)
-
group_max
public Variable group_max
The group max variable or null if no group max.
-
having_clause
public SearchExpression having_clause
The having clause.
-
composite_function
int composite_function
If there is a composite function this is set to the composite enumeration from CompositeTable.
-
is_composite_all
boolean is_composite_all
If this is an ALL composite (no removal of duplicate rows) it is true.
-
next_composite
TableSelectExpression next_composite
The composite table itself.
-
-
Method Detail
-
chainComposite
public void chainComposite(TableSelectExpression expression, java.lang.String composite, boolean is_all)
Chains a new composite function to this expression. For example, if this expression is a UNION ALL with another expression it would be set through this method.
-
prepareAllInList
private static void prepareAllInList(java.util.List list, ExpressionPreparer preparer) throws DatabaseExceptionPrepares all the expressions in the list.- Throws:
DatabaseException
-
prepareExpressions
public void prepareExpressions(ExpressionPreparer preparer) throws DatabaseException
Description copied from interface:StatementTreeObjectPrepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.- Specified by:
prepareExpressionsin interfaceStatementTreeObject- Throws:
DatabaseException
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDescription copied from interface:StatementTreeObjectPerforms 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:
clonein interfaceStatementTreeObject- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-