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
A derived table.
-
Field Summary
Fields inherited from class org.h2.table.Table
columns, compareMode, EXCLUSIVE_LOCK, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCKFields 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, USERFields 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
ConstructorsConstructorDescriptionDerivedTable(SessionLocal session, String name, Column[] columnTemplates, Query query, Query topQuery) Create a derived table out of the given query. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDrop()Check if this table can be dropped.protected QueryExpressionIndexcreateIndex(SessionLocal session, int[] masks) Construct the CREATE ...Returns the scope of this tablegetSQL(StringBuilder builder, int sqlFlags) Appends the SQL statement of this object to the specified builder.Get the table type namebooleanCheck 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, truncateMethods 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, updateRowsMethods inherited from class org.h2.schema.SchemaObject
getSchema, getSQLMethods 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Constructor Details
-
DerivedTable
public DerivedTable(SessionLocal session, 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 Details
-
createIndex
-
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
Description copied from class:TableGet the table type name- Specified by:
getTableTypein classTable- Returns:
- the table type name
-
getTopQuery
- Specified by:
getTopQueryin classQueryExpressionTable
-
getCreateSQL
Description copied from class:DbObjectConstruct the CREATE ... SQL statement for this object.- Specified by:
getCreateSQLin classDbObject- Returns:
- the SQL statement
-
getSQL
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
Description copied from class:QueryExpressionTableReturns the scope of this table- Specified by:
getQueryScopein classQueryExpressionTable- Returns:
- the scope of this table
-