|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.Query
de.mguennewig.pobjects.memdb.PredicateQuery
public abstract class PredicateQuery
Abstract base class for all queries that are evaluated within the pobjects
library using the Term instead of SQL.
The function calls are limited to the same set as for
in-memory CHECK constraint tests.
SelectExpr and ViewDecl are not supported.
TODO: Queries over multiple tables will return the wrong result, when the tables are not combined over predicates with each other.
TODO: addConj(de.mguennewig.pobjects.Condition) skips terms that do not affect the result.
Even thought it does not change the result the terms should stay in and
ignored by the used EvalContext. The EvalContext should compute
something like a plan.
TODO Distinct queries don't filter on the row tuple as we don't do cross-joins so far and the results for each table can be different in length.
| Field Summary |
|---|
| Fields inherited from class de.mguennewig.pobjects.Query |
|---|
ASCENDING, DESCENDING |
| Constructor Summary | |
|---|---|
PredicateQuery(Container db)
Creates a new empty query. |
|
| Method Summary | |
|---|---|
void |
addConj(Condition condition)
Adds the Condition to the list of boolean expressions, that are
AND'ed together to form the WHERE part of the
statement. |
int |
count()
Returns the number of rows which will be returned by the query. |
EvalContext |
evaluate(boolean forCount)
Evaluates this query. |
Record[][] |
execute()
Executes this query and returns the result. |
PObjResultSet |
executeResultSet()
Executes this query and returns the result set for row-by-row processing. |
| Methods inherited from class de.mguennewig.pobjects.Query |
|---|
addArguments, addJoin, addOrderBy, addOrderBy, addOrderBy, addOrderBy, addTableExpr, addTableExpr, getContainer, getNumTableExprs, getTableExpr, isDistinct, isOrdered, pullInReference, setDistinct, setLimit |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PredicateQuery(Container db)
| Method Detail |
|---|
public void addConj(Condition condition)
Condition to the list of boolean expressions, that are
AND'ed together to form the WHERE part of the
statement.
This method does some optimizations, like splitting AND
expression which contain a join, and ignoring expressions that don't
affect the result.
addConj in class Queryjava.lang.IllegalArgumentException - if condition is null.EvalContext.addWhereConj(de.mguennewig.pobjects.Term)public int count()
count in class Querypublic EvalContext evaluate(boolean forCount)
evaluate in class Querypublic Record[][] execute()
The real evaluation is done in evaluateQuery() and here only
the last steps are done, like ORDER BY, OFFSET
and LIMIT.
execute in class Query
result = new Record[][] {
new Table_1[] { table_1[row_0], table_1[row_1], ... },
new Table_2[] { table_2[row_0], table_2[row_1], ... },
...
};
Query.executeResultSet()public PObjResultSet executeResultSet()
executeResultSet in class Queryjava.lang.UnsupportedOperationExceptionQuery.execute()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||