Top Description Fields Constructors Methods
org.hsqldb

public Class TableBase

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Known Direct Subclasses
org.hsqldb.Table
Imports
org.hsqldb.HsqlNameManager.HsqlName, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.index.Index, org.hsqldb.lib.ArrayUtil, org.hsqldb.navigator.RowIterator, org.hsqldb.persist.DataSpaceManager, .PersistentStore, org.hsqldb.types.Type

The base of all HSQLDB table implementations.
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.7.4

Field Summary

Modifier and TypeField and Description
pack-priv Index
pack-priv int[]
pack-priv int[]
pack-priv boolean
public static final int
public static final int
pack-priv boolean[]
pack-priv Type[]
protected int
public Database
pack-priv boolean[]
pack-priv Index
public static final int
pack-priv boolean
pack-priv Index[]
public static final int
protected boolean
protected boolean
protected boolean
protected boolean
public boolean
public boolean
protected boolean
protected boolean
pack-priv boolean
protected boolean
public static final int
public static final int
public long
public int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public PersistentStore
public static final int
public static final int
pack-priv int
pack-priv int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
addIndex(Session session, Index index)

pack-priv final void
public final Index
createAndAddIndexStructure(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)

public final Index
createIndex(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)

Create new memory-resident index.

public final Index
createIndexStructure(HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean primaryKey, boolean unique, boolean constraint, boolean forward)

public final void
createPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)

public void
dropIndex(Session session, int todrop)

Performs Table structure modification and changes to the index nodes to remove a given index from a MEMORY or TEXT table.

public TableBase
public int
getColumnCount()

Returns the count of all visible columns.

public boolean[]
public final Type[]
getColumnTypes()

Returns an array of Type indicating the SQL type of the columns

public final int
getDataColumnCount()

Returns the count of all columns.

public Index
public final boolean[]
public final Object[]
pack-priv long
public final Index
getIndex(int i)

Returns the Index object at the given index

public final int
public final Index[]
getIndexList()

Returns the indexes

public final boolean[]
getNewColumnCheckList()

Returns empty boolean array.

pack-priv static Index[]
getNewIndexArray(Index index, Index[] list)

pack-priv Index
getNewPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)

public long
public final Index
public final int[]
public final Type[]
public PersistentStore
public int
public final int
public final boolean
public final boolean
isEmpty(Session session)

Returns true if the table has any rows at all.

public boolean
public final boolean
private void
resetAccessorKeys(Session session, Index[] indexes)

public final RowIterator
public final RowIterator
public final void
setBestRowIdentifiers()

This method is called whenever there is a change to table structure and serves two purposes: (a) to reset the best set of columns that identify the rows of the table (b) to reset the best index that can be used to find rows of the table given a column value.

public final void
setIndexes(Index[] indexes)

public void
setSpaceID(int id)

public final void
setTableType(int type)

limited type change to info_schema_table

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bestIndexback to summary
pack-priv Index bestIndex
bestIndexForColumnback to summary
pack-priv int[] bestIndexForColumn
bestRowIdentifierColsback to summary
pack-priv int[] bestRowIdentifierCols
bestRowIdentifierStrictback to summary
pack-priv boolean bestRowIdentifierStrict
CACHED_TABLEback to summary
public static final int CACHED_TABLE
CHANGE_SET_TABLEback to summary
public static final int CHANGE_SET_TABLE
colNotNullback to summary
pack-priv boolean[] colNotNull
colTypesback to summary
pack-priv Type[] colTypes
columnCountback to summary
protected int columnCount
databaseback to summary
public Database database
emptyColumnCheckListback to summary
pack-priv boolean[] emptyColumnCheckList
fullIndexback to summary
pack-priv Index fullIndex
FUNCTION_TABLEback to summary
public static final int FUNCTION_TABLE
hasLobColumnback to summary
pack-priv boolean hasLobColumn
indexListback to summary
pack-priv Index[] indexList
INFO_SCHEMA_TABLEback to summary
public static final int INFO_SCHEMA_TABLE
isCachedback to summary
protected boolean isCached
isLoggedback to summary
protected boolean isLogged
isReadOnlyback to summary
protected boolean isReadOnly
isSchemaBasedback to summary
protected boolean isSchemaBased
isSessionBasedback to summary
public boolean isSessionBased
isSystemVersionedback to summary
public boolean isSystemVersioned
isTempback to summary
protected boolean isTemp
isTextback to summary
protected boolean isText
isViewback to summary
pack-priv boolean isView
isWithDataSourceback to summary
protected boolean isWithDataSource
MEMORY_TABLEback to summary
public static final int MEMORY_TABLE
MODULE_TABLEback to summary
public static final int MODULE_TABLE
persistenceIdback to summary
public long persistenceId
persistenceScopeback to summary
public int persistenceScope
RESULT_TABLEback to summary
public static final int RESULT_TABLE
SCOPE_FULLback to summary
public static final int SCOPE_FULL
SCOPE_ROUTINEback to summary
public static final int SCOPE_ROUTINE
SCOPE_SESSIONback to summary
public static final int SCOPE_SESSION
SCOPE_STATEMENTback to summary
public static final int SCOPE_STATEMENT
SCOPE_TRANSACTIONback to summary
public static final int SCOPE_TRANSACTION
storeback to summary
public PersistentStore store
SYSTEM_SUBQUERYback to summary
public static final int SYSTEM_SUBQUERY
SYSTEM_TABLEback to summary
public static final int SYSTEM_TABLE
tableSpaceback to summary
pack-priv int tableSpace
tableTypeback to summary
pack-priv int tableType
TEMP_TABLEback to summary
public static final int TEMP_TABLE
TEMP_TEXT_TABLEback to summary
public static final int TEMP_TEXT_TABLE
TEXT_TABLEback to summary
public static final int TEXT_TABLE
TRANSITION_TABLEback to summary
public static final int TRANSITION_TABLE
VIEW_TABLEback to summary
public static final int VIEW_TABLE

Constructor Detail

TableBaseback to summary
pack-priv TableBase()

Method Detail

addIndexback to summary
pack-priv final void addIndex(Session session, Index index)
addIndexStructureback to summary
pack-priv final void addIndexStructure(Index index)
createAndAddIndexStructureback to summary
public final Index createAndAddIndexStructure(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)
createIndexback to summary
public final Index createIndex(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)

Create new memory-resident index. For MEMORY and TEXT tables.

createIndexStructureback to summary
public final Index createIndexStructure(HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean primaryKey, boolean unique, boolean constraint, boolean forward)
createPrimaryIndexback to summary
public final void createPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)
dropIndexback to summary
public void dropIndex(Session session, int todrop)

Performs Table structure modification and changes to the index nodes to remove a given index from a MEMORY or TEXT table. Not for PK index.

duplicateback to summary
public TableBase duplicate()
getColumnCountback to summary
public int getColumnCount()

Returns the count of all visible columns.

getColumnNotNullback to summary
public boolean[] getColumnNotNull()
getColumnTypesback to summary
public final Type[] getColumnTypes()

Returns an array of Type indicating the SQL type of the columns

getDataColumnCountback to summary
public final int getDataColumnCount()

Returns the count of all columns.

getDefaultIndexback to summary
public Index getDefaultIndex()
getEmptyColumnCheckListback to summary
public final boolean[] getEmptyColumnCheckList()
getEmptyRowDataback to summary
public final Object[] getEmptyRowData()
getIdback to summary
pack-priv long getId()
getIndexback to summary
public final Index getIndex(int i)

Returns the Index object at the given index

getIndexCountback to summary
public final int getIndexCount()
getIndexListback to summary
public final Index[] getIndexList()

Returns the indexes

getNewColumnCheckListback to summary
public final boolean[] getNewColumnCheckList()

Returns empty boolean array.

getNewIndexArrayback to summary
pack-priv static Index[] getNewIndexArray(Index index, Index[] list)
getNewPrimaryIndexback to summary
pack-priv Index getNewPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)
getPersistenceIdback to summary
public long getPersistenceId()
getPrimaryIndexback to summary
public final Index getPrimaryIndex()
getPrimaryKeyback to summary
public final int[] getPrimaryKey()
getPrimaryKeyTypesback to summary
public final Type[] getPrimaryKeyTypes()
getRowStoreback to summary
public PersistentStore getRowStore(Session session)
getSpaceIDback to summary
public int getSpaceID()
getTableTypeback to summary
public final int getTableType()
hasPrimaryKeyback to summary
public final boolean hasPrimaryKey()
isEmptyback to summary
public final boolean isEmpty(Session session)

Returns true if the table has any rows at all.

isSystemVersionedback to summary
public boolean isSystemVersioned()
onCommitPreserveback to summary
public final boolean onCommitPreserve()
resetAccessorKeysback to summary
private void resetAccessorKeys(Session session, Index[] indexes)
rowIteratorback to summary
public final RowIterator rowIterator(Session session)
rowIteratorback to summary
public final RowIterator rowIterator(PersistentStore store)
setBestRowIdentifiersback to summary
public final void setBestRowIdentifiers()

This method is called whenever there is a change to table structure and serves two purposes: (a) to reset the best set of columns that identify the rows of the table (b) to reset the best index that can be used to find rows of the table given a column value. (a) gives most weight to a primary key index, followed by a unique address with the lowest count of nullable columns. Otherwise there is no best row identifier. (b) finds for each column an index with a corresponding first column. It uses any type of visible index and accepts the one with the largest column count. bestIndex is the user defined, primary key, the first unique index, or the first non-unique index. NULL if there is no user-defined index.

setIndexesback to summary
public final void setIndexes(Index[] indexes)
setSpaceIDback to summary
public void setSpaceID(int id)
setTableTypeback to summary
public final void setTableType(int type)

limited type change to info_schema_table