Package org.h2.table
Class DerivedTable
- java.lang.Object
-
- org.h2.engine.DbObject
-
- org.h2.schema.SchemaObject
-
- org.h2.table.Table
-
- org.h2.table.QueryExpressionTable
-
- org.h2.table.DerivedTable
-
- All Implemented Interfaces:
HasSQL
public final class DerivedTable extends QueryExpressionTable
A derived table.
-
-
Field Summary
-
Fields inherited from class org.h2.table.Table
columns, compareMode, EXCLUSIVE_LOCK, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCK
-
Fields inherited from class org.h2.engine.DbObject
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER
-
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
-
Constructor Summary
Constructors Constructor Description DerivedTable(SessionLocal session, java.lang.String name, Column[] columnTemplates, Query query, Query topQuery)Create a derived table out of the given query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDrop()Check if this table can be dropped.protected QueryExpressionIndexcreateIndex(SessionLocal session, int[] masks)java.lang.StringgetCreateSQL()Construct the CREATE ...QueryScopegetQueryScope()Returns the scope of this tablejava.lang.StringBuildergetSQL(java.lang.StringBuilder builder, int sqlFlags)Appends the SQL statement of this object to the specified builder.TableTypegetTableType()Get the table type nameQuerygetTopQuery()booleanisQueryComparable()Check whether the table (or view) contains no columns that prevent index conditions to be used.-
Methods inherited from class org.h2.table.QueryExpressionTable
addDependencies, addIndex, addRow, canGetRowCount, canReference, checkSupportAlter, close, createQueryColumnTemplateList, getBestPlanItem, getIndexes, getMaxDataModificationId, getParameterOffset, getQuery, getRowCount, getRowCountApproximation, getScanIndex, getScanIndex, isDeterministic, isInsertable, isView, removeRow, truncate
-
Methods inherited from class org.h2.table.Table
addConstraint, addDependentMaterializedView, addDependentView, addSequence, addSynonym, addTrigger, canTruncate, checkDeadlock, checkWritingAllowed, compareValues, convertInsertRow, convertUpdateRow, createRow, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findColumn, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDependentMaterializedViews, getDependentViews, getDiskSpaceUsed, getIdentityColumn, getIndex, getIndexForColumn, getMainIndexColumn, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowFactory, getRowIdColumn, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, getVisibleColumns, hasSelectTrigger, isGlobalTemporary, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isRowLockable, lock, lockRow, removeChildrenAndResources, removeColumnExpressionsDependencies, removeConstraint, removeDependentMaterializedView, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setOnCommitDrop, setOnCommitTruncate, unlock, updateRow, updateRows
-
Methods inherited from class org.h2.schema.SchemaObject
getSchema, getSQL
-
Methods inherited from class org.h2.engine.DbObject
checkRename, equals, getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, hashCode, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
-
-
-
Constructor Detail
-
DerivedTable
public DerivedTable(SessionLocal session, java.lang.String name, Column[] columnTemplates, Query query, Query topQuery)
Create a derived table out of the given query.- Parameters:
session- the sessionname- the view namecolumnTemplates- column templates, ornullquery- the initialized querytopQuery- the top level query
-
-
Method Detail
-
createIndex
protected QueryExpressionIndex createIndex(SessionLocal session, int[] masks)
-
isQueryComparable
public boolean isQueryComparable()
Description copied from class:TableCheck 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.- Overrides:
isQueryComparablein classQueryExpressionTable- Returns:
- true if the table contains no query-comparable column
-
canDrop
public boolean canDrop()
Description copied from class:TableCheck if this table can be dropped.
-
getTableType
public TableType getTableType()
Description copied from class:TableGet the table type name- Specified by:
getTableTypein classTable- Returns:
- the table type name
-
getTopQuery
public Query getTopQuery()
- Specified by:
getTopQueryin classQueryExpressionTable
-
getCreateSQL
public java.lang.String getCreateSQL()
Description copied from class:DbObjectConstruct the CREATE ... SQL statement for this object.- Specified by:
getCreateSQLin classDbObject- Returns:
- the SQL statement
-
getSQL
public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder, int sqlFlags)Description copied from interface:HasSQLAppends the SQL statement of this object to the specified builder.- Specified by:
getSQLin interfaceHasSQL- Overrides:
getSQLin classSchemaObject- Parameters:
builder- string buildersqlFlags- formatting flags- Returns:
- the specified string builder
-
getQueryScope
public QueryScope getQueryScope()
Description copied from class:QueryExpressionTableReturns the scope of this table- Specified by:
getQueryScopein classQueryExpressionTable- Returns:
- the scope of this table
-
-