|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.table.TableFilter
public class TableFilter
A table filter represents a table that is used in a query. There is one such object whenever a table (or view) is used in a query. For example the following query has 2 table filters: SELECT * FROM TEST T1, TEST T2.
Nested Class Summary | |
---|---|
static interface |
TableFilter.TableFilterVisitor
A visitor for table filters. |
Field Summary | |
---|---|
protected boolean |
joinOuterIndirect
Whether this is a direct or indirect (nested) outer join |
protected Session |
session
|
Constructor Summary | |
---|---|
TableFilter(Session session,
Table table,
java.lang.String alias,
boolean rightsChecked,
Select select)
Create a new table filter object. |
Method Summary | |
---|---|
void |
addFilterCondition(Expression condition,
boolean isJoin)
Add a filter condition. |
void |
addIndexCondition(IndexCondition condition)
Add an index condition. |
void |
addJoin(TableFilter filter,
boolean outer,
boolean nested,
Expression on)
Add a joined table. |
void |
addNaturalJoinColumn(Column c)
Add a column to the natural join key column list. |
Row |
get()
Get the current row. |
PlanItem |
getBestPlanItem(Session s,
int level)
Get the best plan item (index, cost) to use use for the current join order. |
Column[] |
getColumns()
Get the column list. |
Expression |
getFilterCondition()
|
Index |
getIndex()
|
TableFilter |
getJoin()
|
Expression |
getJoinCondition()
|
TableFilter |
getNestedJoin()
|
java.lang.String |
getPlanSQL(boolean isJoin)
Get the query execution plan text to use for this table filter. |
java.lang.String |
getSchemaName()
Get the schema name. |
Select |
getSelect()
Get the select statement. |
Column[] |
getSystemColumns()
Get the system columns that this table understands. |
Table |
getTable()
|
java.lang.String |
getTableAlias()
Get the table alias name. |
TableFilter |
getTableFilter()
Get the table filter. |
Value |
getValue(Column column)
Get the value for the given column. |
int |
hashCode()
|
boolean |
hasInComparisons()
Are there any index conditions that involve IN(...). |
boolean |
isEvaluatable()
|
boolean |
isJoinOuter()
Whether this is an outer joined table. |
boolean |
isJoinOuterIndirect()
Whether this is indirectly an outer joined table (nested within an inner join). |
boolean |
isNaturalJoinColumn(Column c)
Check if the given column is a natural join column. |
boolean |
isUsed()
|
void |
lock(Session s,
boolean exclusive,
boolean force)
Lock the table. |
void |
lockRow(java.util.ArrayList<Row> rows)
Add the current row to the array, if there is a current row. |
void |
lockRows(java.util.ArrayList<Row> forUpdateRows)
Lock the given rows. |
void |
mapAndAddFilter(Expression on)
Map the columns and add the join condition. |
boolean |
next()
Check if there are more rows to read. |
Expression |
optimize(ExpressionColumn expressionColumn,
Column column)
Get the expression that represents this column. |
void |
prepare()
Prepare reading rows. |
void |
removeFilterCondition()
Remove the filter condition. |
void |
removeJoin()
Remove the joined table |
void |
removeJoinCondition()
Remove the join condition. |
void |
reset()
Reset to the current position. |
void |
set(Row current)
Set the current row. |
void |
setAlias(java.lang.String alias)
|
void |
setEvaluatable(boolean evaluatable)
|
void |
setEvaluatable(TableFilter filter,
boolean b)
Update the filter and join conditions of this and all joined tables with the information that the given table filter can now return rows or not. |
void |
setFullCondition(Expression condition)
|
void |
setIndex(Index index)
|
protected void |
setNullRow()
Set the state of this and all nested tables to the NULL row. |
void |
setPlanItem(PlanItem item)
Set what plan item (index, cost) to use use. |
void |
setUsed(boolean used)
|
void |
startQuery(Session s)
Start the query. |
java.lang.String |
toString()
|
void |
visit(TableFilter.TableFilterVisitor visitor)
Visit this and all joined or nested table filters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Session session
protected boolean joinOuterIndirect
Constructor Detail |
---|
public TableFilter(Session session, Table table, java.lang.String alias, boolean rightsChecked, Select select)
session
- the sessiontable
- the table from where to read dataalias
- the alias namerightsChecked
- true if rights are already checkedselect
- the select statementMethod Detail |
---|
public Select getSelect()
ColumnResolver
getSelect
in interface ColumnResolver
public Table getTable()
public void lock(Session s, boolean exclusive, boolean force)
s
- the sessionexclusive
- true if an exclusive lock is requiredforce
- lock even in the MVCC modepublic PlanItem getBestPlanItem(Session s, int level)
s
- the sessionlevel
- 1 for the first table in a join, 2 for the second, and so on
public void setPlanItem(PlanItem item)
item
- the plan itempublic void prepare()
public void startQuery(Session s)
s
- the sessionpublic void reset()
public boolean next()
protected void setNullRow()
public Row get()
public void set(Row current)
current
- the current rowpublic java.lang.String getTableAlias()
getTableAlias
in interface ColumnResolver
public void addIndexCondition(IndexCondition condition)
condition
- the index conditionpublic void addFilterCondition(Expression condition, boolean isJoin)
condition
- the conditionisJoin
- if this is in fact a join conditionpublic void addJoin(TableFilter filter, boolean outer, boolean nested, Expression on)
filter
- the joined table filterouter
- if this is an outer joinnested
- if this is a nested joinon
- the join conditionpublic void mapAndAddFilter(Expression on)
on
- the conditionpublic TableFilter getJoin()
public boolean isJoinOuter()
public boolean isJoinOuterIndirect()
public java.lang.String getPlanSQL(boolean isJoin)
isJoin
- if this is a joined table
public Index getIndex()
public void setIndex(Index index)
public void setUsed(boolean used)
public boolean isUsed()
public void removeJoin()
public Expression getJoinCondition()
public void removeJoinCondition()
public Expression getFilterCondition()
public void removeFilterCondition()
public void setFullCondition(Expression condition)
public void setEvaluatable(TableFilter filter, boolean b)
filter
- the table filterb
- the new flagpublic void setEvaluatable(boolean evaluatable)
public java.lang.String getSchemaName()
ColumnResolver
getSchemaName
in interface ColumnResolver
public Column[] getColumns()
ColumnResolver
getColumns
in interface ColumnResolver
public Column[] getSystemColumns()
getSystemColumns
in interface ColumnResolver
public Value getValue(Column column)
ColumnResolver
getValue
in interface ColumnResolver
column
- the column
public TableFilter getTableFilter()
ColumnResolver
getTableFilter
in interface ColumnResolver
public void setAlias(java.lang.String alias)
public Expression optimize(ExpressionColumn expressionColumn, Column column)
ColumnResolver
optimize
in interface ColumnResolver
expressionColumn
- the expression columncolumn
- the column
public java.lang.String toString()
toString
in class java.lang.Object
public void addNaturalJoinColumn(Column c)
c
- the column to addpublic boolean isNaturalJoinColumn(Column c)
c
- the column to check
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasInComparisons()
public void lockRow(java.util.ArrayList<Row> rows)
rows
- the rows to lockpublic void lockRows(java.util.ArrayList<Row> forUpdateRows)
forUpdateRows
- the rows to lockpublic TableFilter getNestedJoin()
public void visit(TableFilter.TableFilterVisitor visitor)
visitor
- the visitorpublic boolean isEvaluatable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |