![]() |
Quadcap Embeddable Database |
Inheritance diagram for com.quadcap.sql.SelectExpression:

Definition at line 63 of file SelectExpression.java.
Public Member Functions | |
| SelectExpression () | |
| Default constructor. | |
| SelectExpression (String tableName, Expression where) | |
| The typical 'select from table where' stuff. | |
| Vector | getFrom () |
| Get the FROM list. | |
| void | setDistinct (boolean b) |
| Set the DISTINCT flag. | |
| void | setItems (Vector v) |
| Set the select items (i.e., the colums returned from this select). | |
| void | setFrom (Vector v) |
| Set the from list (a list of tables is implicitly joined). | |
| void | setGroupBy (Vector v) |
| Set the GROUP BY clause as a list of names. | |
| void | setHaving (Expression e) |
| Set the HAVING expression. | |
| int | rank () |
| We're a table. | |
| boolean | isUpdatable () |
| Well, a bunch of things can prevent us from being updateable. | |
| Cursor | getCursor (Session session, Cursor cur) throws SQLException |
| This is the main entry point to this madness. | |
| Value | getValue (Session session, Cursor cur) throws SQLException |
| Return the expression as a scalar value. | |
| void | getBaseTables (Vector v) |
| Get the base tables that participate in this select expression. | |
| void | visitSubExpressions (ExpressionVisitor ev) |
| Expression implementation... | |
| void | invert () |
| Nope, I'm not a boolean. | |
| void | readExternal (ObjectInput in) throws IOException, ClassNotFoundException |
| Read me from a stream. | |
| void | writeExternal (ObjectOutput out) throws IOException |
| Write me to a stream. | |
| String | toString () |
| Return a string representation for debugging purposes. | |
| String | name () |
Static Public Member Functions | |
| final void | showCursor (Cursor c) |
| Display a cursor (under trace control). | |
| void | showCursor (Cursor c, boolean really) |
| Display c cursor (or not). | |
Package Functions | |
| TableExpression | scheduleJoin () throws SQLException |
| Cross-join multiple tables in 'from' clause. | |
| boolean | isAggregate (Session session, Vector items) throws SQLException |
| Check the list of select items to see if any of them are aggregate expressions. | |
| Cursor | staticCursor (Session session, Cursor c, Vector items, Value v) throws SQLException |
| Helper to create a cursor containing a single constant value. | |
| Cursor | optimizeAggregate (Session session, Cursor c, Vector items) throws SQLException |
| Identify cases of MIN(column) or MAX(column) on indexed columns. | |
Package Attributes | |
| boolean | distinct = false |
| Vector | items = null |
| Vector | from = null |
| Vector | groupBy = null |
| Expression | having = null |
| Vector | aggregates = null |
|
|
Default constructor.
Definition at line 76 of file SelectExpression.java. |
|
||||||||||||
|
The typical 'select from table where' stuff.
Definition at line 81 of file SelectExpression.java. |
|
|
Get the base tables that participate in this select expression.
Implements com.quadcap.sql.TableExpression. Definition at line 398 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.from, and com.quadcap.sql.SelectExpression.getBaseTables(). Referenced by com.quadcap.sql.SelectExpression.getBaseTables(), and com.quadcap.sql.StmtInsert.IsSelfInsert.visit(). |
|
||||||||||||
|
|
Get the FROM list.
Definition at line 91 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.from. |
|
||||||||||||
|
Return the expression as a scalar value. We try. If there's only a single column in the result, we just return the column's value for the first row of the result. Otherwise, return ValueNull. Reimplemented from com.quadcap.sql.Expression. Definition at line 376 of file SelectExpression.java. References com.quadcap.sql.Cursor.close(), com.quadcap.sql.Cursor.getRow(), com.quadcap.sql.SelectExpression.getValue(), com.quadcap.sql.Row.item(), com.quadcap.sql.Cursor.next(), and com.quadcap.sql.Row.size(). Referenced by com.quadcap.sql.SelectExpression.getValue(). |
|
|
Nope, I'm not a boolean.
Reimplemented from com.quadcap.sql.Expression. Definition at line 438 of file SelectExpression.java. |
|
||||||||||||
|
Check the list of select items to see if any of them are aggregate expressions. (Side effect: set 'aggregates' variable.) Definition at line 295 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.IsAggregate.aggregates, com.quadcap.sql.SelectItem.getExpression(), com.quadcap.sql.SelectExpression.groupBy, com.quadcap.sql.SelectExpression.isAggregate(), com.quadcap.sql.SelectExpression.items, com.quadcap.sql.SelectExpression.IsAggregate.reset(), com.quadcap.sql.SelectExpression.IsAggregate.seenAggregate, com.quadcap.sql.SelectExpression.IsAggregate.seenName, and com.quadcap.sql.SelectExpression.IsAggregate.visit(). Referenced by com.quadcap.sql.SelectExpression.getCursor(), and com.quadcap.sql.SelectExpression.isAggregate(). |
|
|
Well, a bunch of things can prevent us from being updateable. Here are the ones we know about: Implements com.quadcap.sql.TableExpression. Definition at line 129 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.aggregates, com.quadcap.sql.SelectExpression.distinct, com.quadcap.sql.SelectExpression.from, com.quadcap.sql.SelectExpression.groupBy, com.quadcap.sql.SelectExpression.having, and com.quadcap.sql.TableExpression.isUpdatable(). |
|
|
Implements com.quadcap.sql.TableExpression. Definition at line 534 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.toString(). Referenced by com.quadcap.sql.SelectExpression.getCursor(). |
|
||||||||||||||||
|
Identify cases of MIN(column) or MAX(column) on indexed columns. Compute the value directly and replace the index cursor with a static cursor containing the value. Definition at line 332 of file SelectExpression.java. References com.quadcap.sql.AggregateExpression.all, com.quadcap.sql.Cursor.close(), com.quadcap.sql.Constraint.getColumn(), com.quadcap.sql.IndexCursor.getConstraint(), com.quadcap.sql.SelectItem.getExpression(), com.quadcap.sql.AggregateExpression.getInnerExpression(), com.quadcap.sql.Column.getName(), com.quadcap.sql.NameExpression.getName(), com.quadcap.sql.AggregateExpression.isCount(), com.quadcap.sql.AggregateExpression.isMax(), com.quadcap.sql.AggregateExpression.isMin(), com.quadcap.sql.Row.item(), com.quadcap.sql.SelectExpression.items, and com.quadcap.sql.SelectExpression.optimizeAggregate(). Referenced by com.quadcap.sql.SelectExpression.getCursor(), and com.quadcap.sql.SelectExpression.optimizeAggregate(). |
|
|
We're a table.
Implements com.quadcap.sql.TableExpression. Definition at line 123 of file SelectExpression.java. |
|
|
Read me from a stream.
Definition at line 446 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.readExternal(). Referenced by com.quadcap.sql.SelectExpression.readExternal(). |
|
|
Cross-join multiple tables in 'from' clause. TODO: First, tables which have selection constraintsfind pairs of tables that have candidate join columns and greedily join them. Next, pick tables which have matching non-key join columns and join them Finally, join all the rest. Definition at line 151 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.from. Referenced by com.quadcap.sql.SelectExpression.getCursor(). |
|
|
Set the DISTINCT flag.
Definition at line 98 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.setDistinct(). Referenced by com.quadcap.sql.SQLParser.querySpecification(), and com.quadcap.sql.SelectExpression.setDistinct(). |
|
|
Set the from list (a list of tables is implicitly joined).
Definition at line 108 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.setFrom(). Referenced by com.quadcap.sql.SQLParser.querySpecification(), and com.quadcap.sql.SelectExpression.setFrom(). |
|
|
Set the GROUP BY clause as a list of names.
Definition at line 113 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.setGroupBy(). Referenced by com.quadcap.sql.SQLParser.querySpecification(), and com.quadcap.sql.SelectExpression.setGroupBy(). |
|
|
Set the HAVING expression.
Definition at line 118 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.setHaving(). Referenced by com.quadcap.sql.SQLParser.querySpecification(), and com.quadcap.sql.SelectExpression.setHaving(). |
|
|
Set the select items (i.e., the colums returned from this select).
Definition at line 103 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.setItems(). Referenced by com.quadcap.sql.SQLParser.querySpecification(), and com.quadcap.sql.SelectExpression.setItems(). |
|
||||||||||||
|
Display c cursor (or not).
Definition at line 524 of file SelectExpression.java. |
|
|
Display a cursor (under trace control).
Definition at line 511 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.showCursor(). Referenced by com.quadcap.sql.SelectExpression.getCursor(), and com.quadcap.sql.SelectExpression.showCursor(). |
|
||||||||||||||||||||
|
Helper to create a cursor containing a single constant value.
Definition at line 318 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.items, com.quadcap.sql.Row.set(), and com.quadcap.sql.SelectExpression.staticCursor(). Referenced by com.quadcap.sql.SelectExpression.staticCursor(). |
|
|
Return a string representation for debugging purposes.
Implements com.quadcap.sql.Expression. Definition at line 472 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.from, com.quadcap.sql.SelectExpression.groupBy, com.quadcap.sql.SelectExpression.having, com.quadcap.sql.SelectExpression.items, and com.quadcap.sql.Expression.toString(). Referenced by com.quadcap.sql.SelectExpression.name(). |
|
|
Expression implementation...
Reimplemented from com.quadcap.sql.Expression. Definition at line 407 of file SelectExpression.java. References com.quadcap.sql.ExpressionVisitor.visit(), and com.quadcap.sql.SelectExpression.visitSubExpressions(). Referenced by com.quadcap.sql.SelectExpression.visitSubExpressions(). |
|
|
Write me to a stream.
Definition at line 460 of file SelectExpression.java. References com.quadcap.sql.SelectExpression.distinct, com.quadcap.sql.SelectExpression.from, com.quadcap.sql.SelectExpression.groupBy, com.quadcap.sql.SelectExpression.having, com.quadcap.sql.SelectExpression.items, and com.quadcap.sql.SelectExpression.writeExternal(). Referenced by com.quadcap.sql.SelectExpression.writeExternal(). |
|
|
Definition at line 71 of file SelectExpression.java. Referenced by com.quadcap.sql.SelectExpression.getCursor(), and com.quadcap.sql.SelectExpression.isUpdatable(). |
|
|
Definition at line 66 of file SelectExpression.java. Referenced by com.quadcap.sql.SelectExpression.getCursor(), com.quadcap.sql.SelectExpression.isUpdatable(), and com.quadcap.sql.SelectExpression.writeExternal(). |
|
|
|
|
Definition at line 70 of file SelectExpression.java. Referenced by com.quadcap.sql.SelectExpression.getCursor(), com.quadcap.sql.SelectExpression.isUpdatable(), com.quadcap.sql.SelectExpression.toString(), and com.quadcap.sql.SelectExpression.writeExternal(). |
|