Package org.h2.table

# Class TableBase

java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.table.Table
org.h2.table.TableBase

All Implemented Interfaces:
  `HasSQL`

Direct Known Subclasses:
  `MVTable`

public abstract class TableBase extends Table
The base class of a regular table, or a user defined 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
`TableBase(CreateTableData data)`

## Method Summary

Modifier and Type
Method
Description
`String`
`getCreateSQL()`
Construct the CREATE ...
`String`
`getCreateSQLForMeta()`
Construct the CREATE ...
`String`
`getDropSQL()`
Construct a DROP ...
`static int`
`getMainIndexColumn(IndexType indexType, IndexColumn[] cols)`
Returns main index column if index is an primary key index and has only one column with _ROWID_ compatible data type.
`boolean`
`isGlobalTemporary()`

### Methods inherited from class org.h2.table.Table

`addConstraint, addDependencies, addDependentMaterializedView, addDependentView, addIndex, addRow, addSequence, addSynonym, addTrigger, canDrop, canGetRowCount, canReference, canTruncate, checkDeadlock, checkSupportAlter, checkWritingAllowed, close, 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, getIndexes, getIndexForColumn, getMainIndexColumn, getMaxDataModificationId, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowCount, getRowCountApproximation, getRowFactory, getRowIdColumn, getScanIndex, getScanIndex, getSQLTableType, getTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, getVisibleColumns, hasSelectTrigger, isDeterministic, isInsertable, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isQueryComparable, isRowLockable, isView, lock, lockRow, removeChildrenAndResources, removeColumnExpressionsDependencies, removeConstraint, removeDependentMaterializedView, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeRow, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setOnCommitDrop, setOnCommitTruncate, truncate, unlock, updateRow, updateRows`

### Methods inherited from class org.h2.schema.SchemaObject

`getSchema, getSQL, getSQL`

### Methods inherited from class org.h2.engine.DbObject

`checkRename, getComment, getCreateSQLForCopy, getDatabase, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

## Constructor Details

### TableBase

public TableBase(CreateTableData data)

## Method Details

### getMainIndexColumn

public static int getMainIndexColumn(IndexType indexType, IndexColumn[] cols)
Returns main index column if index is an primary key index and has only one column with _ROWID_ compatible data type.

Parameters:
  `indexType` - type of an index
  `cols` - columns of the index
Returns:
  main index column or `SearchRow.ROWID_INDEX`

### getDropSQL

public String getDropSQL()
Description copied from class: `DbObject`
Construct a DROP ... SQL statement for this object.

Overrides:
  `getDropSQL` in class `DbObject`
Returns:
  the SQL statement

### getCreateSQLForMeta

public String getCreateSQLForMeta()
Description copied from class: `DbObject`
Construct the CREATE ... SQL statement for this object for meta table.

Overrides:
  `getCreateSQLForMeta` in class `DbObject`
Returns:
  the SQL statement

### getCreateSQL

public String getCreateSQL()
Description copied from class: `DbObject`
Construct the CREATE ... SQL statement for this object.

Specified by:
  `getCreateSQL` in class `DbObject`
Returns:
  the SQL statement

### isGlobalTemporary

public boolean isGlobalTemporary()

Overrides:
  `isGlobalTemporary` in class `Table`