org.h2.table

## Class Table

- java.lang.Object
- - org.h2.engine.DbObjectBase
  - - org.h2.schema.SchemaObjectBase
    - - org.h2.table.Table

All Implemented Interfaces:
  DbObject, SchemaObject

Direct Known Subclasses:
  FunctionTable, MetaTable, RangeTable, TableBase, TableLink, TableView

    public abstract class Table
    extends SchemaObjectBase

This is the base class for most tables. A table contains a list of columns and a list of rows.

### Field Summary

Fields
`protected Column[]` `columns` The columns of this table.
`protected CompareMode` `compareMode` The compare mode used for this table.
`protected boolean` `isHidden` Protected tables are not listed in the meta data and are excluded when using the SCRIPT command.
`static int` `TYPE_CACHED` The table type that means this table is a regular persistent table.
`static int` `TYPE_MEMORY` The table type that means this table is a regular persistent table.

### Fields inherited from class org.h2.engine.DbObjectBase

`comment, database, trace`

### Fields inherited from interface org.h2.engine.DbObject

`AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, TRIGGER, USER`

### Constructor Summary

Constructors
Constructor and Description
`Table(Schema schema, int id, java.lang.String name, boolean persistIndexes, boolean persistData)`

### Method Summary

Methods
`void` `addConstraint(Constraint constraint)` Add a constraint to the table.
`void` `addDependencies(java.util.HashSet<DbObject> dependencies)` Add all objects that this table depends on to the hash set.
`void` `addDependentView(TableView view)` Add a view to this table.
`abstract Index` `addIndex(Session session, java.lang.String indexName, int indexId, IndexColumn[] cols, IndexType indexType, boolean create, java.lang.String indexComment)` Create an index for this table
`abstract void` `addRow(Session session, Row row)` Add a row to the table and all indexes.
`void` `addSequence(Sequence sequence)` Add a sequence to this table.
`void` `addSynonym(TableSynonym synonym)` Add a synonym to this table.
`void` `addTrigger(TriggerObject trigger)` Add a trigger to this table.
`abstract boolean` `canDrop()` Check if this table can be dropped.
`abstract boolean` `canGetRowCount()` Check if the row count can be retrieved quickly.
`boolean` `canReference()` Check if this table can be referenced.
`boolean` `canTruncate()` Check if this table can be truncated.
`java.util.ArrayList<Session>` `checkDeadlock(Session session, Session clash, java.util.Set<Session> visited)` Check if a deadlock occurred.
`abstract void` `checkSupportAlter()` Check if this table supports ALTER TABLE.
`void` `checkWritingAllowed()` Tests if the table can be written.
`abstract void` `close(Session session)` Close the table object and flush changes.
`int` `compareValues(Value a, Value b)` Compare two values with the current comparison mode.
`Row` `createRow(Value[] data, int memory)` Create a new row for a table.
`boolean` `doesColumnExist(java.lang.String columnName)` Does the column with the given name exist?
`void` `dropMultipleColumnsConstraintsAndIndexes(Session session, java.util.ArrayList<Column> columnsToDrop)` Check that these columns are not referenced by a multi-column constraint or multi-column index.
`Index` `findPrimaryKey()` Get the primary key index if there is one, or null if there is none.
`void` `fire(Session session, int type, boolean beforeAction)` Fire the triggers for this table.
`void` `fireAfterRow(Session session, Row oldRow, Row newRow, boolean rollback)` Fire all triggers that need to be called after a row is updated.
`boolean` `fireBeforeRow(Session session, Row oldRow, Row newRow)` Fire all triggers that need to be called before a row is updated.
`boolean` `fireRow()` Check if row based triggers or constraints are defined.
`PlanItem` `getBestPlanItem(Session session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)` Get the best plan for the given search mask.
`boolean` `getCheckForeignKeyConstraints()`
`java.util.ArrayList<DbObject>` `getChildren()` Get the list of dependent children (for tables, this includes indexes and so on).
`Column` `getColumn(int index)` Get the column at the given index.
`Column` `getColumn(java.lang.String columnName)` Get the column with the given name.
`Column[]` `getColumns()`
`CompareMode` `getCompareMode()`
`java.util.ArrayList<Constraint>` `getConstraints()`
`java.lang.String` `getCreateSQLForCopy(Table table, java.lang.String quotedName)` Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table
`Value` `getDefaultValue(Session session, Column column)` Get or generate a default value for the given column.
`java.util.concurrent.CopyOnWriteArrayList<TableView>` `getDependentViews()`
`abstract long` `getDiskSpaceUsed()`
`Index` `getIndex(java.lang.String indexName)` Get an index by name.
`abstract java.util.ArrayList<Index>` `getIndexes()` Get all indexes for this table.
`Index` `getIndexForColumn(Column column, boolean needGetFirstOrLast, boolean needFindNext)` Get the index that has the given column as the first element.
`abstract long` `getMaxDataModificationId()` Get the last data modification id.
`boolean` `getOnCommitDrop()`
`boolean` `getOnCommitTruncate()`
`Value` `getOnUpdateValue(Session session, Column column)` Generates on update value for the given column.
`Index` `getPrimaryKey()`
`Row` `getRow(Session session, long key)` Get the given row.
`abstract long` `getRowCount(Session session)` Get the row count for this table.
`abstract long` `getRowCountApproximation()` Get the approximated row count for this table.
`Column` `getRowIdColumn()` Get the row id column if this table has one.
`abstract Index` `getScanIndex(Session session)` Get the scan index to iterate through all rows.
`Index` `getScanIndex(Session session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)` Get the scan index for this table.
`abstract TableType` `getTableType()` Get the table type name
`Row` `getTemplateRow()`
`SearchRow` `getTemplateSimpleRow(boolean singleColumn)` Get a new simple row object.
`int` `getType()` Get the object type.
`abstract Index` `getUniqueIndex()` Get any unique index for this table if one exists.
`boolean` `hasSelectTrigger()` Check whether this table has a select trigger.
`abstract boolean` `isDeterministic()` Check if the table is deterministic.
`boolean` `isGlobalTemporary()`
`boolean` `isHidden()` Check whether this is a hidden object that doesn't appear in the meta data and in the script, and is not dropped on DROP ALL OBJECTS.
`abstract boolean` `isLockedExclusively()` Check if this table is locked exclusively.
`boolean` `isLockedExclusivelyBy(Session session)` Check if the table is exclusively locked by this session.
`boolean` `isMVStore()`
`boolean` `isPersistData()`
`boolean` `isPersistIndexes()`
`boolean` `isQueryComparable()` Check whether the table (or view) contains no columns that prevent index conditions to be used.
`boolean` `isTableExpression()`
`boolean` `isView()`
`abstract boolean` `lock(Session session, boolean exclusive, boolean forceLockEvenInMvcc)` Lock the table for the given session.
`Row` `lockRow(Session session, Row row)` Locks row, preventing any updated to it, except from the session specified.
`void` `removeChildrenAndResources(Session session)` Remove all dependent objects and free all resources (files, blocks in files) of this object.
`void` `removeConstraint(Constraint constraint)` Remove the given constraint from the list.
`void` `removeDependentView(TableView view)` Remove the given view from the dependent views list.
`void` `removeIndex(Index index)` Remove the given index from the list.
`void` `removeIndexOrTransferOwnership(Session session, Index index)` If the index is still required by a constraint, transfer the ownership to it.
`abstract void` `removeRow(Session session, Row row)` Remove a row from the table and all indexes.
`void` `removeSequence(Sequence sequence)` Remove a sequence from the table.
`void` `removeSynonym(TableSynonym synonym)` Remove the given view from the list.
`void` `removeTrigger(TriggerObject trigger)` Remove the given trigger from the list.
`void` `rename(java.lang.String newName)` Rename the object.
`void` `renameColumn(Column column, java.lang.String newName)` Rename a column of this table.
`void` `setCheckForeignKeyConstraints(Session session, boolean enabled, boolean checkExisting)` Enable or disable foreign key constraint checking for this table.
`protected void` `setColumns(Column[] columns)`
`void` `setHidden(boolean hidden)`
`void` `setOnCommitDrop(boolean onCommitDrop)`
`void` `setOnCommitTruncate(boolean onCommitTruncate)`
`void` `setTableExpression(boolean tableExpression)`
`abstract void` `truncate(Session session)` Remove all rows from the table and indexes.
`abstract void` `unlock(Session s)` Release the lock for this session.
`void` `updateRow(Session session, Row oldRow, Row newRow)` Update a row to the table and all indexes.
`void` `updateRows(Prepared prepared, Session session, RowList rows)` Update a list of rows in this table.
`void` `validateConvertUpdateSequence(Session session, Row row)` Validate all values in this row, convert the values if required, and update the sequence values if required.

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

`getSchema, getSQL, getSQL`

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

`checkRename, getComment, getCreateSQL, getDatabase, getDropSQL, 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.engine.DbObject

`checkRename, getComment, getCreateSQL, getDatabase, getDropSQL, getId, getName, isTemporary, setComment, setTemporary`

### Field Detail

#### TYPE_CACHED

    public static final int TYPE_CACHED

The table type that means this table is a regular persistent table.

See Also:
  Constant Field Values

#### TYPE_MEMORY

    public static final int TYPE_MEMORY

The table type that means this table is a regular persistent table.

See Also:
  Constant Field Values

#### columns

    protected Column[] columns

The columns of this table.

#### compareMode

    protected CompareMode compareMode

The compare mode used for this table.

#### isHidden

    protected boolean isHidden

Protected tables are not listed in the meta data and are excluded when using the SCRIPT command.

### Constructor Detail

#### Table

    public Table(Schema schema,
         int id,
         java.lang.String name,
         boolean persistIndexes,
         boolean persistData)

### Method Detail

#### rename

    public void rename(java.lang.String newName)

Description copied from interface: `DbObject`
Rename the object.

Specified by:
  `rename` in interface `DbObject`
Overrides:
  `rename` in class `DbObjectBase`
Parameters:
  `newName` - the new name

#### isView

    public boolean isView()

#### lock

    public abstract boolean lock(Session session,
               boolean exclusive,
               boolean forceLockEvenInMvcc)

Lock the table for the given session. This method waits until the lock is granted.

Parameters:
  `session` - the session
  `exclusive` - true for write locks, false for read locks
  `forceLockEvenInMvcc` - lock even in the MVCC mode
Returns:
  true if the table was already exclusively locked by this session.
Throws:
  `DbException` - if a lock timeout occurred

#### close

    public abstract void close(Session session)

Close the table object and flush changes.

Parameters:
  `session` - the session

#### unlock

    public abstract void unlock(Session s)

Release the lock for this session.

Parameters:
  `s` - the session

#### addIndex

    public abstract Index addIndex(Session session,
                 java.lang.String indexName,
                 int indexId,
                 IndexColumn[] cols,
                 IndexType indexType,
                 boolean create,
                 java.lang.String indexComment)

Create an index for this table

Parameters:
  `session` - the session
  `indexName` - the name of the index
  `indexId` - the id
  `cols` - the index columns
  `indexType` - the index type
  `create` - whether this is a new index
  `indexComment` - the comment
Returns:
  the index

#### getRow

    public Row getRow(Session session,
             long key)

Get the given row.

Parameters:
  `session` - the session
  `key` - the primary key
Returns:
  the row

#### removeRow

    public abstract void removeRow(Session session,
                 Row row)

Remove a row from the table and all indexes.

Parameters:
  `session` - the session
  `row` - the row

#### lockRow

    public Row lockRow(Session session,
              Row row)

Locks row, preventing any updated to it, except from the session specified.

Parameters:
  `session` - the session
  `row` - to lock
Returns:
  locked row, or null if row does not exist anymore

#### truncate

    public abstract void truncate(Session session)

Remove all rows from the table and indexes.

Parameters:
  `session` - the session

#### addRow

    public abstract void addRow(Session session,
              Row row)

Add a row to the table and all indexes.

Parameters:
  `session` - the session
  `row` - the row
Throws:
  `DbException` - if a constraint was violated

#### updateRow

    public void updateRow(Session session,
                 Row oldRow,
                 Row newRow)

Update a row to the table and all indexes.

Parameters:
  `session` - the session
  `oldRow` - the row to update
  `newRow` - the row with updated values (_rowid_ suppose to be the same)
Throws:
  `DbException` - if a constraint was violated

#### checkSupportAlter

    public abstract void checkSupportAlter()

Check if this table supports ALTER TABLE.

Throws:
  `DbException` - if it is not supported

#### getTableType

    public abstract TableType getTableType()

Get the table type name

Returns:
  the table type name

#### getScanIndex

    public abstract Index getScanIndex(Session session)

Get the scan index to iterate through all rows.

Parameters:
  `session` - the session
Returns:
  the index

#### getScanIndex

    public Index getScanIndex(Session session,
                     int[] masks,
                     TableFilter[] filters,
                     int filter,
                     SortOrder sortOrder,
                     AllColumnsForPlan allColumnsSet)

Get the scan index for this table.

Parameters:
  `session` - the session
  `masks` - the search mask
  `filters` - the table filters
  `filter` - the filter index
  `sortOrder` - the sort order
  `allColumnsSet` - all columns
Returns:
  the scan index

#### getUniqueIndex

    public abstract Index getUniqueIndex()

Get any unique index for this table if one exists.

Returns:
  a unique index

#### getIndexes

    public abstract java.util.ArrayList<Index> getIndexes()

Get all indexes for this table.

Returns:
  the list of indexes

#### getIndex

    public Index getIndex(java.lang.String indexName)

Get an index by name.

Parameters:
  `indexName` - the index name to search for
Returns:
  the found index

#### isLockedExclusively

    public abstract boolean isLockedExclusively()

Check if this table is locked exclusively.

Returns:
  true if it is.

#### getMaxDataModificationId

    public abstract long getMaxDataModificationId()

Get the last data modification id.

Returns:
  the modification id

#### isDeterministic

    public abstract boolean isDeterministic()

Check if the table is deterministic.

Returns:
  true if it is

#### canGetRowCount

    public abstract boolean canGetRowCount()

Check if the row count can be retrieved quickly.

Returns:
  true if it can

#### canReference

    public boolean canReference()

Check if this table can be referenced.

Returns:
  true if it can

#### canDrop

    public abstract boolean canDrop()

Check if this table can be dropped.

Returns:
  true if it can

#### getRowCount

    public abstract long getRowCount(Session session)

Get the row count for this table.

Parameters:
  `session` - the session
Returns:
  the row count

#### getRowCountApproximation

    public abstract long getRowCountApproximation()

Get the approximated row count for this table.

Returns:
  the approximated row count

#### getDiskSpaceUsed

    public abstract long getDiskSpaceUsed()

#### getRowIdColumn

    public Column getRowIdColumn()

Get the row id column if this table has one.

Returns:
  the row id column, or null

#### getCreateSQLForCopy

    public java.lang.String getCreateSQLForCopy(Table table,
                                       java.lang.String quotedName)

Description copied from interface: `DbObject`
Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

Parameters:
  `table` - the new table
  `quotedName` - the quoted name
Returns:
  the SQL statement

#### isQueryComparable

    public boolean 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:
  true if the table contains no query-comparable column

#### addDependencies

    public void addDependencies(java.util.HashSet<DbObject> dependencies)

Add all objects that this table depends on to the hash set.

Parameters:
  `dependencies` - the current set of dependencies

#### getChildren

    public java.util.ArrayList<DbObject> getChildren()

Description copied from interface: `DbObject`
Get the list of dependent children (for tables, this includes indexes and so on).

Specified by:
  `getChildren` in interface `DbObject`
Overrides:
  `getChildren` in class `DbObjectBase`
Returns:
  the list of children

#### setColumns

    protected void setColumns(Column[] columns)

#### renameColumn

    public void renameColumn(Column column,
                    java.lang.String newName)

Rename a column of this table.

Parameters:
  `column` - the column to rename
  `newName` - the new column name

#### isLockedExclusivelyBy

    public boolean isLockedExclusivelyBy(Session session)

Check if the table is exclusively locked by this session.

Parameters:
  `session` - the session
Returns:
  true if it is

#### updateRows

    public void updateRows(Prepared prepared,
                  Session session,
                  RowList rows)

Update a list of rows in this table.

Parameters:
  `prepared` - the prepared statement
  `session` - the session
  `rows` - a list of row pairs of the form old row, new row, old row, new row,...

#### getDependentViews

    public java.util.concurrent.CopyOnWriteArrayList<TableView> getDependentViews()

#### removeChildrenAndResources

    public void removeChildrenAndResources(Session session)

Description copied from class: `DbObjectBase`
Remove all dependent objects and free all resources (files, blocks in files) of this object.

Specified by:
  `removeChildrenAndResources` in interface `DbObject`
Specified by:
  `removeChildrenAndResources` in class `DbObjectBase`
Parameters:
  `session` - the session

#### dropMultipleColumnsConstraintsAndIndexes

    public void dropMultipleColumnsConstraintsAndIndexes(Session session,
                                                java.util.ArrayList<Column> columnsToDrop)

Check that these columns are not referenced by a multi-column constraint or multi-column index. If it is, an exception is thrown. Single-column references and indexes are dropped.

Parameters:
  `session` - the session
  `columnsToDrop` - the columns to drop
Throws:
  `DbException` - if the column is referenced by multi-column constraints or indexes

#### createRow

    public Row createRow(Value[] data,
                int memory)

Create a new row for a table.

Parameters:
  `data` - the values.
  `memory` - whether the row is in memory.
Returns:
  the created row.

#### getTemplateRow

    public Row getTemplateRow()

#### getTemplateSimpleRow

    public SearchRow getTemplateSimpleRow(boolean singleColumn)

Get a new simple row object.

Parameters:
  `singleColumn` - if only one value need to be stored
Returns:
  the simple row object

#### getColumns

    public Column[] getColumns()

#### getType

    public int getType()

Description copied from interface: `DbObject`
Get the object type.

Returns:
  the object type

#### getColumn

    public Column getColumn(int index)

Get the column at the given index.

Parameters:
  `index` - the column index (0, 1,...)
Returns:
  the column

#### getColumn

    public Column getColumn(java.lang.String columnName)

Get the column with the given name.

Parameters:
  `columnName` - the column name
Returns:
  the column
Throws:
  `DbException` - if the column was not found

#### doesColumnExist

    public boolean doesColumnExist(java.lang.String columnName)

Does the column with the given name exist?

Parameters:
  `columnName` - the column name
Returns:
  true if the column exists

#### getBestPlanItem

    public PlanItem getBestPlanItem(Session session,
                           int[] masks,
                           TableFilter[] filters,
                           int filter,
                           SortOrder sortOrder,
                           AllColumnsForPlan allColumnsSet)

Get the best plan for the given search mask.

Parameters:
  `session` - the session
  `masks` - per-column comparison bit masks, null means 'always false', see constants in IndexCondition
  `filters` - all joined table filters
  `filter` - the current table filter index
  `sortOrder` - the sort order
  `allColumnsSet` - the set of all columns
Returns:
  the plan item

#### findPrimaryKey

    public Index findPrimaryKey()

Get the primary key index if there is one, or null if there is none.

Returns:
  the primary key index or null

#### getPrimaryKey

    public Index getPrimaryKey()

#### validateConvertUpdateSequence

    public void validateConvertUpdateSequence(Session session,
                                     Row row)

Validate all values in this row, convert the values if required, and update the sequence values if required. This call will also set the default values if required and set the computed column if there are any.

Parameters:
  `session` - the session
  `row` - the row

#### removeIndex

    public void removeIndex(Index index)

Remove the given index from the list.

Parameters:
  `index` - the index to remove

#### removeDependentView

    public void removeDependentView(TableView view)

Remove the given view from the dependent views list.

Parameters:
  `view` - the view to remove

#### removeSynonym

    public void removeSynonym(TableSynonym synonym)

Remove the given view from the list.

Parameters:
  `synonym` - the synonym to remove

#### removeConstraint

    public void removeConstraint(Constraint constraint)

Remove the given constraint from the list.

Parameters:
  `constraint` - the constraint to remove

#### removeSequence

    public final void removeSequence(Sequence sequence)

Remove a sequence from the table. Sequences are used as identity columns.

Parameters:
  `sequence` - the sequence to remove

#### removeTrigger

    public void removeTrigger(TriggerObject trigger)

Remove the given trigger from the list.

Parameters:
  `trigger` - the trigger to remove

#### addDependentView

    public void addDependentView(TableView view)

Add a view to this table.

Parameters:
  `view` - the view to add

#### addSynonym

    public void addSynonym(TableSynonym synonym)

Add a synonym to this table.

Parameters:
  `synonym` - the synonym to add

#### addConstraint

    public void addConstraint(Constraint constraint)

Add a constraint to the table.

Parameters:
  `constraint` - the constraint to add

#### getConstraints

    public java.util.ArrayList<Constraint> getConstraints()

#### addSequence

    public void addSequence(Sequence sequence)

Add a sequence to this table.

Parameters:
  `sequence` - the sequence to add

#### addTrigger

    public void addTrigger(TriggerObject trigger)

Add a trigger to this table.

Parameters:
  `trigger` - the trigger to add

#### fire

    public void fire(Session session,
            int type,
            boolean beforeAction)

Fire the triggers for this table.

Parameters:
  `session` - the session
  `type` - the trigger type
  `beforeAction` - whether 'before' triggers should be called

#### hasSelectTrigger

    public boolean hasSelectTrigger()

Check whether this table has a select trigger.

Returns:
  true if it has

#### fireRow

    public boolean fireRow()

Check if row based triggers or constraints are defined. In this case the fire after and before row methods need to be called.

Returns:
  if there are any triggers or rows defined

#### fireBeforeRow

    public boolean fireBeforeRow(Session session,
                        Row oldRow,
                        Row newRow)

Fire all triggers that need to be called before a row is updated.

Parameters:
  `session` - the session
  `oldRow` - the old data or null for an insert
  `newRow` - the new data or null for a delete
Returns:
  true if no further action is required (for 'instead of' triggers)

#### fireAfterRow

    public void fireAfterRow(Session session,
                    Row oldRow,
                    Row newRow,
                    boolean rollback)

Fire all triggers that need to be called after a row is updated.

Parameters:
  `session` - the session
  `oldRow` - the old data or null for an insert
  `newRow` - the new data or null for a delete
  `rollback` - when the operation occurred within a rollback

#### isGlobalTemporary

    public boolean isGlobalTemporary()

#### canTruncate

    public boolean canTruncate()

Check if this table can be truncated.

Returns:
  true if it can

#### setCheckForeignKeyConstraints

    public void setCheckForeignKeyConstraints(Session session,
                                     boolean enabled,
                                     boolean checkExisting)

Enable or disable foreign key constraint checking for this table.

Parameters:
  `session` - the session
  `enabled` - true if checking should be enabled
  `checkExisting` - true if existing rows must be checked during this call

#### getCheckForeignKeyConstraints

    public boolean getCheckForeignKeyConstraints()

Returns:
  is foreign key constraint checking enabled for this table.

#### getIndexForColumn

    public Index getIndexForColumn(Column column,
                          boolean needGetFirstOrLast,
                          boolean needFindNext)

Get the index that has the given column as the first element. This method returns null if no matching index is found.

Parameters:
  `column` - the column
  `needGetFirstOrLast` - if the returned index must be able to do `Index.canGetFirstOrLast()`
  `needFindNext` - if the returned index must be able to do `Index.findNext(Session, SearchRow, SearchRow)`
Returns:
  the index or null

#### getOnCommitDrop

    public boolean getOnCommitDrop()

#### setOnCommitDrop

    public void setOnCommitDrop(boolean onCommitDrop)

#### getOnCommitTruncate

    public boolean getOnCommitTruncate()

#### setOnCommitTruncate

    public void setOnCommitTruncate(boolean onCommitTruncate)

#### removeIndexOrTransferOwnership

    public void removeIndexOrTransferOwnership(Session session,
                                      Index index)

If the index is still required by a constraint, transfer the ownership to it. Otherwise, the index is removed.

Parameters:
  `session` - the session
  `index` - the index that is no longer required

#### checkDeadlock

    public java.util.ArrayList<Session> checkDeadlock(Session session,
                                             Session clash,
                                             java.util.Set<Session> visited)

Check if a deadlock occurred. This method is called recursively. There is a circle if the session to be tested has already being visited. If this session is part of the circle (if it is the clash session), the method must return an empty object array. Once a deadlock has been detected, the methods must add the session to the list. If this session is not part of the circle, or if no deadlock is detected, this method returns null.

Parameters:
  `session` - the session to be tested for
  `clash` - set with sessions already visited, and null when starting verification
  `visited` - set with sessions already visited, and null when starting verification
Returns:
  an object array with the sessions involved in the deadlock, or null

#### isPersistIndexes

    public boolean isPersistIndexes()

#### isPersistData

    public boolean isPersistData()

#### compareValues

    public int compareValues(Value a,
                    Value b)

Compare two values with the current comparison mode. The values may be of different type.

Parameters:
  `a` - the first value
  `b` - the second value
Returns:
  0 if both values are equal, -1 if the first value is smaller, and 1 otherwise

#### getCompareMode

    public CompareMode getCompareMode()

#### checkWritingAllowed

    public void checkWritingAllowed()

Tests if the table can be written. Usually, this depends on the database.checkWritingAllowed method, but some tables (eg. TableLink) overwrite this default behaviour.

#### getDefaultValue

    public Value getDefaultValue(Session session,
                        Column column)

Get or generate a default value for the given column.

Parameters:
  `session` - the session
  `column` - the column
Returns:
  the value

#### getOnUpdateValue

    public Value getOnUpdateValue(Session session,
                         Column column)

Generates on update value for the given column.

Parameters:
  `session` - the session
  `column` - the column
Returns:
  the value

#### isHidden

    public boolean isHidden()

Description copied from interface: `SchemaObject`
Check whether this is a hidden object that doesn't appear in the meta data and in the script, and is not dropped on DROP ALL OBJECTS.

Specified by:
  `isHidden` in interface `SchemaObject`
Overrides:
  `isHidden` in class `SchemaObjectBase`
Returns:
  true if it is hidden

#### setHidden

    public void setHidden(boolean hidden)

#### isMVStore

    public boolean isMVStore()

#### setTableExpression

    public void setTableExpression(boolean tableExpression)

#### isTableExpression

    public boolean isTableExpression()