Top Description Fields Constructors Methods
org.h2.table

public final Class DerivedTable

extends QueryExpressionTable
Class Inheritance
Imports
java.util.ArrayList, org.h2.api.ErrorCode, org.h2.command.QueryScope, org.h2.command.query.Query, org.h2.engine.SessionLocal, org.h2.expression.ExpressionVisitor, .Parameter, org.h2.index.QueryExpressionIndex, .RegularQueryExpressionIndex, org.h2.message.DbException, org.h2.util.StringUtils

A derived table.

Field Summary

Modifier and TypeField and Description
private final ArrayList<Parameter>
private final String
private final Query
Inherited from org.h2.table.QueryExpressionTable:
tablesviewQuery

Constructor Summary

AccessConstructor and Description
public
DerivedTable(SessionLocal
the session
session
,
String
the view name
name
,
Column[]
column templates, or null
columnTemplates
,
Query
the initialized query
query
,
Query
the top level query
topQuery
)

Create a derived table out of the given query.

Method Summary

Modifier and TypeMethod and Description
public boolean
canDrop()

Implements abstract org.h2.table.Table.canDrop.

Check if this table can be dropped.

protected QueryExpressionIndex
public String
getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ...

public QueryScope
getQueryScope()

Implements abstract org.h2.table.QueryExpressionTable.getQueryScope.

Returns the scope of this table

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.schema.SchemaObject.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public TableType
getTableType()

Implements abstract org.h2.table.Table.getTableType.

Get the table type name

public Query
public boolean
isQueryComparable()

Overrides org.h2.table.QueryExpressionTable.isQueryComparable.

Check whether the table (or view) contains no columns that prevent index conditions to be used.

Inherited from org.h2.table.QueryExpressionTable:
addDependenciesaddIndexaddRowcanGetRowCountcanReferencecheckSupportAlterclosecreateQueryColumnTemplateListgetBestPlanItemgetIndexesgetMaxDataModificationIdgetParameterOffsetgetQuerygetRowCountgetRowCountApproximationgetScanIndexgetScanIndexinitColumnsisDeterministicisInsertableisViewremoveRowtruncate

Field Detail

originalParametersback to summary
private final ArrayList<Parameter> originalParameters
querySQLback to summary
private final String querySQL
topQueryback to summary
private final Query topQuery

Constructor Detail

DerivedTableback to summary
public DerivedTable(SessionLocal session, String name, Column[] columnTemplates, Query query, Query topQuery)

Create a derived table out of the given query.

Parameters
session:SessionLocal

the session

name:String

the view name

columnTemplates:Column[]

column templates, or null

query:Query

the initialized query

topQuery:Query

the top level query

Method Detail

canDropback to summary
public boolean canDrop()

Implements abstract org.h2.table.Table.canDrop.

Doc from org.h2.table.Table.canDrop.

Check if this table can be dropped.

Returns:boolean

true if it can

Annotations
@Override
createIndexback to summary
protected QueryExpressionIndex createIndex(SessionLocal session, int[] masks)

Implements abstract org.h2.table.QueryExpressionTable.createIndex.

Annotations
@Override
getCreateSQLback to summary
public String getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

Annotations
@Override
getQueryScopeback to summary
public QueryScope getQueryScope()

Implements abstract org.h2.table.QueryExpressionTable.getQueryScope.

Doc from org.h2.table.QueryExpressionTable.getQueryScope.

Returns the scope of this table

Returns:QueryScope

the scope of this table

Annotations
@Override
getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.schema.SchemaObject.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getTableTypeback to summary
public TableType getTableType()

Implements abstract org.h2.table.Table.getTableType.

Doc from org.h2.table.Table.getTableType.

Get the table type name

Returns:TableType

the table type name

Annotations
@Override
getTopQueryback to summary
public Query getTopQuery()

Implements abstract org.h2.table.QueryExpressionTable.getTopQuery.

Annotations
@Override
isQueryComparableback to summary
public boolean isQueryComparable()

Overrides org.h2.table.QueryExpressionTable.isQueryComparable.

Doc from org.h2.table.Table.isQueryComparable.

Check whether the table (or view) contains no columns that prevent index conditions to be used. For example, a view that contains the ROWNUM() pseudo-column prevents this.

Returns:boolean

true if the table contains no query-comparable column

Annotations
@Override