org.hsqldb
Class TableBase
- java.lang.Object
-
- org.hsqldb.TableBase
-
- Direct Known Subclasses:
- Table
public class TableBase extends java.lang.ObjectThe base of all HSQLDB table implementations.- Since:
- 1.7.2
-
-
Field Summary
Fields Modifier and Type Field and Description static intCACHED_TABLEstatic intCHANGE_SET_TABLEDatabasedatabasestatic intFUNCTION_TABLEstatic intINFO_SCHEMA_TABLEbooleanisSessionBasedstatic intMEMORY_TABLElongpersistenceIdintpersistenceScopestatic intRESULT_TABLEstatic intSCOPE_FULLstatic intSCOPE_ROUTINEstatic intSCOPE_SESSIONstatic intSCOPE_STATEMENTstatic intSCOPE_TRANSACTIONPersistentStorestorestatic intSYSTEM_SUBQUERYstatic intSYSTEM_TABLEstatic intTEMP_TABLEstatic intTEMP_TEXT_TABLEstatic intTEXT_TABLEstatic intTRANSITION_TABLEstatic intVIEW_TABLE
-
Constructor Summary
Constructors Constructor and Description TableBase(Session session, Database database, int scope, int type, Type[] colTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearAllData(PersistentStore store)voidclearAllData(Session session)IndexcreateAndAddIndexStructure(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)IndexcreateIndex(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)Create new memory-resident index.voidcreatePrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)voiddropIndex(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.TableBaseduplicate()intgetColumnCount()Returns the count of all visible columns.boolean[]getColumnNotNull()Type[]getColumnTypes()Returns an array of Type indicating the SQL type of the columnsintgetDataColumnCount()Returns the count of all columns.java.lang.Object[]getEmptyRowData()IndexgetFullIndex()Returns an index on all the columnsIndexgetIndex(int i)Returns the Index object at the given indexintgetIndexCount()Index[]getIndexList()Returns the indexesboolean[]getNewColumnCheckList()Returns empty boolean array.longgetPersistenceId()IndexgetPrimaryIndex()int[]getPrimaryKey()Type[]getPrimaryKeyTypes()PersistentStoregetRowStore(Session session)intgetSpaceID()intgetTableType()booleanhasPrimaryKey()booleanisEmpty(Session session)Returns true if the table has any rows at all.booleanisTransactional()booleanonCommitPreserve()RowIteratorrowIterator(PersistentStore store)RowIteratorrowIterator(Session session)voidsetBestRowIdentifiers()This method is called whenever there is a change to table structure and serves two porposes: (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.voidsetIndexes(Index[] indexes)voidsetSpaceID(int id)voidsetTransactional(boolean value)
-
-
-
Field Detail
-
INFO_SCHEMA_TABLE
public static final int INFO_SCHEMA_TABLE
- See Also:
- Constant Field Values
-
SYSTEM_SUBQUERY
public static final int SYSTEM_SUBQUERY
- See Also:
- Constant Field Values
-
TEMP_TABLE
public static final int TEMP_TABLE
- See Also:
- Constant Field Values
-
MEMORY_TABLE
public static final int MEMORY_TABLE
- See Also:
- Constant Field Values
-
CACHED_TABLE
public static final int CACHED_TABLE
- See Also:
- Constant Field Values
-
TEMP_TEXT_TABLE
public static final int TEMP_TEXT_TABLE
- See Also:
- Constant Field Values
-
TEXT_TABLE
public static final int TEXT_TABLE
- See Also:
- Constant Field Values
-
VIEW_TABLE
public static final int VIEW_TABLE
- See Also:
- Constant Field Values
-
RESULT_TABLE
public static final int RESULT_TABLE
- See Also:
- Constant Field Values
-
TRANSITION_TABLE
public static final int TRANSITION_TABLE
- See Also:
- Constant Field Values
-
FUNCTION_TABLE
public static final int FUNCTION_TABLE
- See Also:
- Constant Field Values
-
SYSTEM_TABLE
public static final int SYSTEM_TABLE
- See Also:
- Constant Field Values
-
CHANGE_SET_TABLE
public static final int CHANGE_SET_TABLE
- See Also:
- Constant Field Values
-
SCOPE_ROUTINE
public static final int SCOPE_ROUTINE
- See Also:
- Constant Field Values
-
SCOPE_STATEMENT
public static final int SCOPE_STATEMENT
- See Also:
- Constant Field Values
-
SCOPE_TRANSACTION
public static final int SCOPE_TRANSACTION
- See Also:
- Constant Field Values
-
SCOPE_SESSION
public static final int SCOPE_SESSION
- See Also:
- Constant Field Values
-
SCOPE_FULL
public static final int SCOPE_FULL
- See Also:
- Constant Field Values
-
store
public PersistentStore store
-
persistenceScope
public int persistenceScope
-
persistenceId
public long persistenceId
-
database
public Database database
-
isSessionBased
public boolean isSessionBased
-
-
Method Detail
-
duplicate
public TableBase duplicate()
-
getTableType
public final int getTableType()
-
getPersistenceId
public long getPersistenceId()
-
getSpaceID
public int getSpaceID()
-
setSpaceID
public void setSpaceID(int id)
-
onCommitPreserve
public final boolean onCommitPreserve()
-
rowIterator
public final RowIterator rowIterator(Session session)
-
rowIterator
public final RowIterator rowIterator(PersistentStore store)
-
getIndexCount
public final int getIndexCount()
-
getPrimaryIndex
public final Index getPrimaryIndex()
-
getPrimaryKeyTypes
public final Type[] getPrimaryKeyTypes()
-
hasPrimaryKey
public final boolean hasPrimaryKey()
-
getPrimaryKey
public final int[] getPrimaryKey()
-
getColumnTypes
public final Type[] getColumnTypes()
Returns an array of Type indicating the SQL type of the columns
-
getFullIndex
public Index getFullIndex()
Returns an index on all the columns
-
getIndex
public final Index getIndex(int i)
Returns the Index object at the given index
-
getIndexList
public final Index[] getIndexList()
Returns the indexes
-
getNewColumnCheckList
public final boolean[] getNewColumnCheckList()
Returns empty boolean array.
-
getColumnCount
public int getColumnCount()
Returns the count of all visible columns.
-
getDataColumnCount
public final int getDataColumnCount()
Returns the count of all columns.
-
isTransactional
public boolean isTransactional()
-
setTransactional
public void setTransactional(boolean value)
-
setBestRowIdentifiers
public final void setBestRowIdentifiers()
This method is called whenever there is a change to table structure and serves two porposes: (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.
-
getColumnNotNull
public boolean[] getColumnNotNull()
-
createPrimaryIndex
public final void createPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlNameManager.HsqlName name)
-
createAndAddIndexStructure
public final Index createAndAddIndexStructure(Session session, HsqlNameManager.HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward)
-
dropIndex
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.
-
setIndexes
public final void setIndexes(Index[] indexes)
-
getEmptyRowData
public final java.lang.Object[] getEmptyRowData()
-
createIndex
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.
-
clearAllData
public void clearAllData(Session session)
-
clearAllData
public void clearAllData(PersistentStore store)
-
isEmpty
public final boolean isEmpty(Session session)
Returns true if the table has any rows at all.
-
getRowStore
public PersistentStore getRowStore(Session session)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG