Package org.h2.table
Class VirtualTable
java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.table.Table
org.h2.table.VirtualTable
- All Implemented Interfaces:
HasSQL
- Direct Known Subclasses:
DualTable,RangeTable,VirtualConstructedTable
A base class for virtual tables.
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIndex(SessionLocal session, String indexName, int indexId, IndexColumn[] cols, int uniqueColumnCount, IndexType indexType, boolean create, String indexComment) Create an index for this tablevoidaddRow(SessionLocal session, Row row) Add a row to the table and all indexes.booleancanDrop()Check if this table can be dropped.booleanCheck if this table can be referenced.voidCheck if renaming is allowed.voidCheck if this table supports ALTER TABLE.voidclose(SessionLocal session) Close the table object and flush changes.Construct the CREATE ...Get all indexes for this table.getSQL(StringBuilder builder, int sqlFlags) Appends the SQL statement of this object to the specified builder.Get the table type namebooleanReturns whether this table is insertable.voidremoveRow(SessionLocal session, Row row) Remove a row from the table and all indexes.longtruncate(SessionLocal session) Remove all rows from the table and indexes.Methods inherited from class org.h2.table.Table
addConstraint, addDependencies, addDependentMaterializedView, addDependentView, addSequence, addSynonym, addTrigger, canGetRowCount, canTruncate, checkDeadlock, checkWritingAllowed, compareValues, convertInsertRow, convertUpdateRow, createRow, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findColumn, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getBestPlanItem, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDependentMaterializedViews, getDependentViews, getDiskSpaceUsed, getIdentityColumn, getIndex, getIndexForColumn, getMainIndexColumn, getMaxDataModificationId, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowCount, getRowCountApproximation, getRowFactory, getRowIdColumn, getScanIndex, getScanIndex, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, getVisibleColumns, hasSelectTrigger, isDeterministic, isGlobalTemporary, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isQueryComparable, isRowLockable, isView, 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
getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Constructor Details
-
VirtualTable
-
-
Method Details
-
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
-
close
Description copied from class:TableClose the table object and flush changes. -
addIndex
public Index addIndex(SessionLocal session, String indexName, int indexId, IndexColumn[] cols, int uniqueColumnCount, IndexType indexType, boolean create, String indexComment) Description copied from class:TableCreate an index for this table- Specified by:
addIndexin classTable- Parameters:
session- the sessionindexName- the name of the indexindexId- the idcols- the index columnsuniqueColumnCount- the count of unique columnsindexType- the index typecreate- whether this is a new indexindexComment- the comment- Returns:
- the index
-
isInsertable
public boolean isInsertable()Description copied from class:TableReturns whether this table is insertable.- Overrides:
isInsertablein classTable- Returns:
- whether this table is insertable
-
removeRow
Description copied from class:TableRemove a row from the table and all indexes. -
truncate
Description copied from class:TableRemove all rows from the table and indexes. -
addRow
Description copied from class:TableAdd a row to the table and all indexes. -
checkSupportAlter
public void checkSupportAlter()Description copied from class:TableCheck if this table supports ALTER TABLE.- Specified by:
checkSupportAlterin classTable
-
getTableType
Description copied from class:TableGet the table type name- Specified by:
getTableTypein classTable- Returns:
- the table type name
-
getIndexes
Description copied from class:TableGet all indexes for this table.- Specified by:
getIndexesin classTable- Returns:
- the list of indexes
-
canReference
public boolean canReference()Description copied from class:TableCheck if this table can be referenced.- Overrides:
canReferencein classTable- Returns:
- true if it can
-
canDrop
public boolean canDrop()Description copied from class:TableCheck if this table can be dropped. -
getCreateSQL
Description copied from class:DbObjectConstruct the CREATE ... SQL statement for this object.- Specified by:
getCreateSQLin classDbObject- Returns:
- the SQL statement
-
checkRename
public void checkRename()Description copied from class:DbObjectCheck if renaming is allowed. Does nothing when allowed.- Overrides:
checkRenamein classDbObject
-