|
||||||||
| 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.
| 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,
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()
|
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 |
isJoinOuter()
Check if this is an outer joined table. |
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 |
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(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)
|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| 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 statement| Method Detail |
|---|
public Select getSelect()
ColumnResolver
getSelect in interface ColumnResolverpublic 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 mode
public 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()
public Row get()
public void set(Row current)
current - the current rowpublic java.lang.String getTableAlias()
getTableAlias in interface ColumnResolverpublic void addIndexCondition(IndexCondition condition)
condition - the index condition
public void addFilterCondition(Expression condition,
boolean isJoin)
condition - the conditionisJoin - if this is in fact a join condition
public void addJoin(TableFilter filter,
boolean outer,
Expression on)
filter - the joined table filterouter - if this is an outer joinon - the join conditionpublic void mapAndAddFilter(Expression on)
on - the conditionpublic TableFilter getJoin()
public boolean isJoinOuter()
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 java.lang.String getSchemaName()
ColumnResolver
getSchemaName in interface ColumnResolverpublic Column[] getColumns()
ColumnResolver
getColumns in interface ColumnResolverpublic Column[] getSystemColumns()
getSystemColumns in interface ColumnResolverpublic Value getValue(Column column)
ColumnResolver
getValue in interface ColumnResolvercolumn - the column
public TableFilter getTableFilter()
ColumnResolver
getTableFilter in interface ColumnResolverpublic void setAlias(java.lang.String alias)
public Expression optimize(ExpressionColumn expressionColumn,
Column column)
ColumnResolver
optimize in interface ColumnResolverexpressionColumn - the expression columncolumn - the column
public java.lang.String toString()
toString in class java.lang.Objectpublic 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.Objectpublic boolean hasInComparisons()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||