|
||||||||
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 join)
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 session,
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 join)
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 session,
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 session)
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) throws java.sql.SQLException
session
- the sessiontable
- the table from where to read dataalias
- the alias namerightsChecked
- true if rights are already checkedselect
- the select statement
java.sql.SQLException
Method Detail |
---|
public Select getSelect()
ColumnResolver
getSelect
in interface ColumnResolver
public Table getTable()
public void lock(Session session, boolean exclusive, boolean force) throws java.sql.SQLException
session
- the sessionexclusive
- true if an exclusive lock is requiredforce
- lock even in the MVCC mode
java.sql.SQLException
public PlanItem getBestPlanItem(Session session, int level) throws java.sql.SQLException
session
- the sessionlevel
- 1 for the first table in a join, 2 for the second, and so on
java.sql.SQLException
public void setPlanItem(PlanItem item)
item
- the plan itempublic void prepare() throws java.sql.SQLException
java.sql.SQLException
public void startQuery(Session session)
session
- the sessionpublic void reset()
public boolean next() throws java.sql.SQLException
java.sql.SQLException
public Row get() throws java.sql.SQLException
java.sql.SQLException
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 join)
condition
- the conditionjoin
- if this is in fact a join conditionpublic void addJoin(TableFilter filter, boolean outer, Expression on) throws java.sql.SQLException
filter
- the joined table filterouter
- if this is an outer joinon
- the join condition
java.sql.SQLException
public void mapAndAddFilter(Expression on) throws java.sql.SQLException
on
- the condition
java.sql.SQLException
public TableFilter getJoin()
public boolean isJoinOuter()
public java.lang.String getPlanSQL(boolean join)
join
- 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 ColumnResolver
public Column[] getColumns()
ColumnResolver
getColumns
in interface ColumnResolver
public Column[] getSystemColumns()
getSystemColumns
in interface ColumnResolver
public Value getValue(Column column) throws java.sql.SQLException
ColumnResolver
getValue
in interface ColumnResolver
column
- the column
java.sql.SQLException
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()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |