| java.lang.Object org.hsqldb.BaseTable org.hsqldb.Table
All known Subclasses: org.hsqldb.View, org.hsqldb.TextTable,
Table | public class Table extends BaseTable (Code) | | Holds the data structures and methods for creation of a database table.
Extensively rewritten and extended in successive versions of HSQLDB.
author: Thomas Mueller (Hypersonic SQL Group) version: 1.8.0 since: Hypersonic SQL |
Method Summary | |
void | addColumn(Column column) Performs the table level checks and adds a column to the table at the
DDL level. | void | addColumns(Result.ResultMetaData metadata, int count) | void | addColumns(Select select) | void | addConstraint(Constraint c) Adds a constraint. | void | addTrigger(TriggerDef trigDef) Adds a trigger. | static void | checkCascadeDelete(Session session, Table table, HashMappedList tableUpdateLists, Row row, boolean delete, HashSet path) Method is called recursively on a tree of tables from the current one
until no referring foreign-key table is left. | static void | checkCascadeUpdate(Session session, Table table, HashMappedList tableUpdateLists, Row orow, Object[] nrow, int[] cols, Table ref, HashSet path) Check or perform an update cascade operation on a single row.
Check or cascade an update (delete/insert) operation.
The method takes a pair of rows (new data,old data) and checks
if Constraints permit the update operation.
A boolean arguement determines if the operation should
realy take place or if we just have to check for constraint violation.
fredt - cyclic conditions are now avoided by checking for second visit
to each constraint. | void | checkColumnInCheckConstraint(String colname) Used for drop column. | void | checkColumnInFKConstraint(int colIndex) Used for retype column. | void | checkColumnInFKConstraint(int colIndex, int actionType) Used for column defaults and nullability. | void | checkColumnsMatch(int[] col, Table other, int[] othercol) | void | checkDataReadOnly() | void | checkDropIndex(String indexname, HashSet ignore, boolean dropPK) Checks for use of a named index in table constraints,
while ignorring a given set of constraints. | void | checkRowDataInsert(Session session, Object[] data) | void | checkRowDataUpdate(Session session, Object[] data, int[] cols) | void | clearAllRows(Session session) | static void | clearUpdateLists(HashMappedList tableUpdateList) | void | commitRowToStore(Row row) | public void | connect(Session session) connects the table to the underlying data source.
This method is available for text tables only.
Parameters: session - denotes the current session. | Index | createIndex(Session session, int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward) Create new memory-resident index. | Index | createIndexStructure(int[] columns, HsqlName name, boolean unique, boolean constraint, boolean forward) Creates the internal structures for an index. | int | createIndexStructureGetNo(int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward) | void | createPrimaryIndex(int[] pkcols, HsqlName name) | void | createPrimaryKey(int[] cols) Shortcut for creating system table PK's. | void | createPrimaryKey() Shortcut for creating default PK's. | void | createPrimaryKey(HsqlName indexName, int[] columns, boolean columnsNotNull) Creates a single or multi-column primary key and index. | int | delete(Session session, HsqlArrayList deleteList) Highest level multiple row delete method. | public void | deleteNoCheckFromLog(Session session, Object[] data) For log statements. | void | deleteNoCheckRollback(Session session, Row row, boolean log) Low level row delete method. | public void | disconnect(Session session) disconnects the table from the underlying data source.
This method is available for text tables only.
Parameters: session - denotes the current session. | void | drop() | void | dropIndex(Session session, String indexname) Performs Table structure modification and changes to the index nodes
to remove a given index from a MEMORY or TEXT table. | void | dropIndexFromRows(Session session, int index) | void | dropTrigger(String name) Drops a trigger. | void | dropTriggers() Drops all triggers. | protected Table | duplicate() returns a basic duplicate of the table without the data structures. | void | enforceFieldValueLimits(Object[] data, int[] cols) Enforce max field sizes according to SQL column definition. | protected void | enforceNullConstraints(Object[] data) Checks a row against NOT NULL constraints on columns. | boolean | equals(Session session, String name) | boolean | equals(String name) | boolean | equals(HsqlName name) | int | findColumn(String c) Returns the index of given column name or -1 if not found. | void | fireAll(Session session, int trigVecIndx, Object[] oldrow, Object[] newrow) | void | fireAll(Session session, int trigVecIndex) Statement level triggers. | int[] | getBestRowIdentifiers() | DataFileCache | getCache() | String | getCatalogName() Returns the catalog name or null, depending on a database property. | Column | getColumn(int i) | public int | getColumnCount() Returns the count of user defined columns. | int[] | getColumnMap() Returns direct mapping array. | int | getColumnNr(String c) | public int[] | getColumnTypes() | Constraint | getConstraint(String constraintName) | Constraint | getConstraintForColumns(Table tablemain, int[] colmain, int[] colref) | int | getConstraintIndex(String constraintName) | Constraint[] | getConstraints() Returns the list of constraints. | protected String | getDataSource() | public Object[] | getEmptyRowData() Returns empty Object array for a new row. | public String | getHeader() For text tables. | public int | getId() | int | getIdentityColumn() Returns the identity column or null. | Index | getIndex(int[] exclude, int colIndex) | Index | getIndex(String indexName) Returns the Index object of the given name or null if not found. | public Index | getIndex(int i) | public int | getIndexCount() Returns the count of indexes on this table. | Index | getIndexForColumn(Session session, int column) Used in TableFilter to get an index for the column. | Index | getIndexForColumns(boolean[] columnCheck) | Index | getIndexForColumns(int[] col, boolean unique) | int | getIndexIndex(String indexName) Returns the index of the Index object of the given name or -1 if not found. | String | getIndexRoots() Returns the string consisting of file pointers to roots of indexes
plus the next identity value (hidden or user defined). | public int[] | getIndexRootsArray() Return the list of file pointers to root nodes for this table's
indexes. | final int | getIndexType() | public Index[] | getIndexes() | int | getInternalColumnCount() Returns total column counts, including hidden ones. | public HsqlName | getName() | boolean[] | getNewColumnCheckList() Returns empty boolean array. | int[] | getNewColumnMap() Returns empty mapping array. | Object[] | getNewRowData(Session session, boolean[] exists) Returns array for a new row with SQL DEFAULT value for each column n
where exists[n] is false. | int | getNextConstraintIndex(int from, int type) | Constraint | getPrimaryConstraint() Returns the primary constraint. | public Index | getPrimaryIndex() | public int[] | getPrimaryKey() Return the user defined primary key column indexes, or empty array for system PK's. | public int[] | getPrimaryKeyTypes() | CachedRow | getRow(int pos, Node primarynode) Used by CACHED tables to fetch a Row from the Cache, resulting in the
Row being read from disk if it is not in the Cache. | CachedRow | getRow(int pos) | CachedRow | getRow(long id) | public int | getRowCount(Session session) | public String | getSchemaName() Returns the schema name. | final public int | getTableType() | Constraint | getUniqueConstraintForColumns(int[] cols) | Index | getUniqueConstraintIndexForColumns(int[] col) Returns the index supporting a constraint with the given column signature. | Constraint | getUniqueOrPKConstraintForIndex(Index index) | public boolean | hasPrimaryKey() | void | indexRow(Session session, Row row) | int | insert(Session session, Result ins) Highest level multiple row insert method. | void | insert(Session session, Object[] data) Highest level method for inserting a single row. | public void | insertData(Session session, Object[] data) Used by the methods above. | public void | insertFromScript(Object[] data) Not for general use. | protected void | insertFromTextSource(CachedRow row) Used by TextCache to insert a row into the indexes when the source
file is first read. | void | insertIntoTable(Session session, Result result) Multi-row insert method. | public void | insertNoCheckFromLog(Session session, Object[] data) | void | insertNoCheckRollback(Session session, Row row, boolean log) | int | insertResult(Session session, Result ins) Used for subquery inserts. | int | insertSys(Result ins) Used for system table inserts. | public void | insertSys(Object[] data) | boolean | isBestRowIdentifiersStrict() | public boolean | isCached() | public boolean | isConnected() determines whether the table is actually connected to the underlying data source. | public boolean | isDataReadOnly() | protected boolean | isDescDataSource() For text tables. | public boolean | isEmpty(Session session) Returns true if the table has any rows at all. | boolean | isFileBased() | boolean | isIndexCached() | boolean | isIndexingMutable() returns false if the table has to be recreated in order to add / drop
indexes. | final public boolean | isReadOnly() | final public boolean | isTemp() | final public boolean | isText() | final boolean | isView() | boolean | isWritable() | HsqlName | makeSysPKName() | static boolean | mergeKeepUpdate(Session session, HashMappedList rowSet, int[] cols, int[] colTypes, Row row, Object[] newData) Merge the full triggered change with the updated row, or add to list. | static void | mergeUpdate(HashMappedList rowSet, Row row, Object[] newData, int[] cols) Merges a triggered change with a previous triggered change, or adds to
list. | void | moveData(Session session, Table from, int colindex, int adjust) Moves the data from table to table.
The colindex argument is the index of the column that was
added or removed. | Table | moveDefinition(int[] removeIndex, Column newColumn, int colIndex, int adjust) | Table | moveDefinitionPK(int[] pkCols, boolean withIdentity) | Row | newRow(Object[] o) Factory method instantiates a Row based on table type. | void | releaseRowFromStore(Row row) | void | removeConstraint(String name) | void | removeRowFromStore(Row row) | void | rename(Session session, String newname, boolean isquoted) Changes table name. | void | renameColumn(Column column, String newName, boolean isquoted) | void | resetDefaultsFlag() | public void | resetRowId(Session session) Necessary when over Integer.MAX_VALUE Row objects have been generated
for a memory table. | Row | restoreRow(Row oldrow) | 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. | void | setColumnTypeVars(int i) | void | setDataReadOnly(boolean value) | protected void | setDataSource(Session s, String source, boolean isDesc, boolean newFile) | void | setDefaultExpression(int columnIndex, Expression def) Sets the SQL default value for a columm. | public void | setHeader(String header) For text tables. | protected void | setIdentityColumn(Session session, Object[] data) If there is an identity column (visible or hidden) on the table, sets
the value and/or adjusts the iIdentiy value for the table. | public void | setIndexRoots(int[] roots) Sets the index roots of a cached/text table to specified file
pointers. | void | setIndexRoots(String s) Sets the index roots and next identity. | protected void | setIsReadOnly(boolean newReadOnly) | int | update(Session session, HashMappedList updateList, int[] cols) Highest level multiple row update method. | void | updateConstraintsTables(Session session, Table old, int colindex, int adjust) Updates the constraint and replaces references to the old table with
the new one, adjusting column index arrays by the given amount. | protected void | updateIdentityValue(Object[] data) If there is an identity column (visible or hidden) on the table, sets
the max identity value. | void | updateRowSet(Session session, HashMappedList rowSet, int[] cols, boolean nodelete) |
CACHED_TABLE | final public static int CACHED_TABLE(Code) | | |
MEMORY_TABLE | final public static int MEMORY_TABLE(Code) | | |
SYSTEM_SUBQUERY | final public static int SYSTEM_SUBQUERY(Code) | | |
SYSTEM_TABLE | final public static int SYSTEM_TABLE(Code) | | |
SYSTEM_VIEW | final static int SYSTEM_VIEW(Code) | | |
TEMP_TABLE | final public static int TEMP_TABLE(Code) | | |
TEMP_TEXT_TABLE | final public static int TEMP_TEXT_TABLE(Code) | | |
TEXT_TABLE | final public static int TEXT_TABLE(Code) | | |
VIEW | final public static int VIEW(Code) | | |
bestIndexForColumn | int[] bestIndexForColumn(Code) | | |
bestRowIdentifierCols | int[] bestRowIdentifierCols(Code) | | |
bestRowIdentifierStrict | boolean bestRowIdentifierStrict(Code) | | |
columnCount | protected int columnCount(Code) | | |
constraintPath | HashSet constraintPath(Code) | | Reusable set of all FK constraints that have so far been enforced while
a cascading insert or delete is in progress. This is emptied and passed
with the first call to checkCascadeDelete or checkCascadeUpdate. During
recursion, if an FK constraint is encountered and is already present
in the set, the recursion stops.
|
identityColumn | int identityColumn(Code) | | |
indexType | protected int indexType(Code) | | |
isCached | protected boolean isCached(Code) | | |
isLogged | protected boolean isLogged(Code) | | |
isMemory | protected boolean isMemory(Code) | | |
isReadOnly | protected boolean isReadOnly(Code) | | |
isTemp | protected boolean isTemp(Code) | | |
isText | protected boolean isText(Code) | | |
onCommitPreserve | protected boolean onCommitPreserve(Code) | | |
sqlEnforceSize | boolean sqlEnforceSize(Code) | | |
tableName | protected HsqlName tableName(Code) | | |
tableUpdateList | HashMappedList tableUpdateList(Code) | | Current list of updates on this table. This is emptied once a cascading
operation is over.
|
addColumn | void addColumn(Column column) throws HsqlException(Code) | | Performs the table level checks and adds a column to the table at the
DDL level. Only used at table creation, not at alter column.
|
checkCascadeDelete | static void checkCascadeDelete(Session session, Table table, HashMappedList tableUpdateLists, Row row, boolean delete, HashSet path) throws HsqlException(Code) | | Method is called recursively on a tree of tables from the current one
until no referring foreign-key table is left. In the process, if a
non-cascading foreign-key referring table contains data, an exception
is thrown. Parameter delete indicates whether to delete refering rows.
The method is called first to check if the row can be deleted, then to
delete the row and all the refering rows.
Support added for SET NULL and SET DEFAULT by kloska@users involves
switching to checkCascadeUpdate(,,,,) when these rules are encountered
in the constraint.(fredt@users)
Parameters: tableUpdateLists - list of update lists Parameters: row - row to delete Parameters: session - Parameters: delete - Parameters: path - throws: HsqlException - |
checkCascadeUpdate | static void checkCascadeUpdate(Session session, Table table, HashMappedList tableUpdateLists, Row orow, Object[] nrow, int[] cols, Table ref, HashSet path) throws HsqlException(Code) | | Check or perform an update cascade operation on a single row.
Check or cascade an update (delete/insert) operation.
The method takes a pair of rows (new data,old data) and checks
if Constraints permit the update operation.
A boolean arguement determines if the operation should
realy take place or if we just have to check for constraint violation.
fredt - cyclic conditions are now avoided by checking for second visit
to each constraint. The set of list of updates for all tables is passed
and filled in recursive calls.
Parameters: session - current database session Parameters: table - Parameters: tableUpdateLists - lists of updates Parameters: orow - old row data to be deleted. Parameters: nrow - new row data to be inserted. Parameters: cols - indices of the columns actually changed. Parameters: ref - This should be initialized to null when themethod is called from the 'outside'. During recursion this will be thecurrent table (i.e. this) to indicate from where we came.Foreign keys to this table do not have to be checked since they havetriggered the update and are valid by definition. |
checkColumnInCheckConstraint | void checkColumnInCheckConstraint(String colname) throws HsqlException(Code) | | Used for drop column.
|
checkColumnInFKConstraint | void checkColumnInFKConstraint(int colIndex) throws HsqlException(Code) | | Used for retype column. Checks whether column is in an FK or is
referenced by a FK
Parameters: colIndex - index |
checkColumnInFKConstraint | void checkColumnInFKConstraint(int colIndex, int actionType) throws HsqlException(Code) | | Used for column defaults and nullability. Checks whether column is in an FK.
Parameters: colIndex - index of column Parameters: refOnly - only check FK columns, not referenced columns |
checkColumnsMatch | void checkColumnsMatch(int[] col, Table other, int[] othercol) throws HsqlException(Code) | | Match two columns arrays for length and type of columns
Parameters: col - column array from this Table Parameters: other - the other Table object Parameters: othercol - column array from the other Table throws: HsqlException - if there is a mismatch |
checkDataReadOnly | void checkDataReadOnly() throws HsqlException(Code) | | Used by INSERT, DELETE, UPDATE operations
|
checkDropIndex | void checkDropIndex(String indexname, HashSet ignore, boolean dropPK) throws HsqlException(Code) | | Checks for use of a named index in table constraints,
while ignorring a given set of constraints.
throws: HsqlException - if index is used in a constraint |
commitRowToStore | void commitRowToStore(Row row)(Code) | | |
connect | public void connect(Session session) throws HsqlException(Code) | | connects the table to the underlying data source.
This method is available for text tables only.
Parameters: session - denotes the current session. Might be null . See Also: setDataSource See Also: disconnect See Also: isConnected |
createIndex | Index createIndex(Session session, int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward) throws HsqlException(Code) | | Create new memory-resident index. For MEMORY and TEXT tables.
|
createIndexStructure | Index createIndexStructure(int[] columns, HsqlName name, boolean unique, boolean constraint, boolean forward) throws HsqlException(Code) | | Creates the internal structures for an index.
|
createIndexStructureGetNo | int createIndexStructureGetNo(int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward) throws HsqlException(Code) | | |
createPrimaryIndex | void createPrimaryIndex(int[] pkcols, HsqlName name) throws HsqlException(Code) | | |
createPrimaryKey | void createPrimaryKey(int[] cols) throws HsqlException(Code) | | Shortcut for creating system table PK's.
|
createPrimaryKey | void createPrimaryKey() throws HsqlException(Code) | | Shortcut for creating default PK's.
|
createPrimaryKey | void createPrimaryKey(HsqlName indexName, int[] columns, boolean columnsNotNull) throws HsqlException(Code) | | Creates a single or multi-column primary key and index. sets the
colTypes array. Finalises the creation of the table. (fredt@users)
|
deleteNoCheckRollback | void deleteNoCheckRollback(Session session, Row row, boolean log) throws HsqlException(Code) | | Low level row delete method. Removes the row from the indexes and
from the Cache. Used by rollback.
|
disconnect | public void disconnect(Session session) throws HsqlException(Code) | | disconnects the table from the underlying data source.
This method is available for text tables only.
Parameters: session - denotes the current session. Might be null . See Also: setDataSource See Also: connect See Also: isConnected |
dropIndex | void dropIndex(Session session, String indexname) throws HsqlException(Code) | | 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.
|
dropTrigger | void dropTrigger(String name)(Code) | | Drops a trigger.
|
dropTriggers | void dropTriggers()(Code) | | Drops all triggers.
|
duplicate | protected Table duplicate() throws HsqlException(Code) | | returns a basic duplicate of the table without the data structures.
|
enforceFieldValueLimits | void enforceFieldValueLimits(Object[] data, int[] cols) throws HsqlException(Code) | | Enforce max field sizes according to SQL column definition.
SQL92 13.8
|
enforceNullConstraints | protected void enforceNullConstraints(Object[] data) throws HsqlException(Code) | | Checks a row against NOT NULL constraints on columns.
|
equals | boolean equals(HsqlName name)(Code) | | |
findColumn | int findColumn(String c)(Code) | | Returns the index of given column name or -1 if not found.
|
fireAll | void fireAll(Session session, int trigVecIndx, Object[] oldrow, Object[] newrow)(Code) | | Fires all row-level triggers of the given set (trigger type)
|
fireAll | void fireAll(Session session, int trigVecIndex)(Code) | | Statement level triggers.
|
getBestRowIdentifiers | int[] getBestRowIdentifiers()(Code) | | |
getCatalogName | String getCatalogName()(Code) | | Returns the catalog name or null, depending on a database property.
|
getColumn | Column getColumn(int i)(Code) | | Returns the Column object at the given index
|
getColumnCount | public int getColumnCount()(Code) | | Returns the count of user defined columns.
|
getColumnMap | int[] getColumnMap()(Code) | | Returns direct mapping array.
|
getColumnNr | int getColumnNr(String c) throws HsqlException(Code) | | Returns the index of given column name or throws if not found
|
getColumnTypes | public int[] getColumnTypes()(Code) | | Returns an array of int valuse indicating the SQL type of the columns
|
getConstraintForColumns | Constraint getConstraintForColumns(Table tablemain, int[] colmain, int[] colref)(Code) | | Returns any foreign key constraint equivalent to the column sets
|
getConstraintIndex | int getConstraintIndex(String constraintName)(Code) | | Return the position of the constraint within the list
|
getConstraints | Constraint[] getConstraints()(Code) | | Returns the list of constraints.
|
getDataSource | protected String getDataSource()(Code) | | For text tables
|
getEmptyRowData | public Object[] getEmptyRowData()(Code) | | Returns empty Object array for a new row.
|
getIdentityColumn | int getIdentityColumn()(Code) | | Returns the identity column or null.
|
getIndex | Index getIndex(int[] exclude, int colIndex)(Code) | | |
getIndex | Index getIndex(String indexName)(Code) | | Returns the Index object of the given name or null if not found.
|
getIndex | public Index getIndex(int i)(Code) | | Returns the Index object at the given index
|
getIndexCount | public int getIndexCount()(Code) | | Returns the count of indexes on this table.
|
getIndexForColumn | Index getIndexForColumn(Session session, int column)(Code) | | Used in TableFilter to get an index for the column.
An index is created automatically for system tables or subqueries.
|
getIndexForColumns | Index getIndexForColumns(boolean[] columnCheck)(Code) | | Used for TableFilter to get an index for the columns
|
getIndexForColumns | Index getIndexForColumns(int[] col, boolean unique) throws HsqlException(Code) | | Finds an existing index for a foreign key column group
|
getIndexIndex | int getIndexIndex(String indexName)(Code) | | Returns the index of the Index object of the given name or -1 if not found.
|
getIndexRoots | String getIndexRoots()(Code) | | Returns the string consisting of file pointers to roots of indexes
plus the next identity value (hidden or user defined). This is used
with CACHED tables.
|
getIndexRootsArray | public int[] getIndexRootsArray()(Code) | | Return the list of file pointers to root nodes for this table's
indexes.
|
getIndexType | final int getIndexType()(Code) | | |
getInternalColumnCount | int getInternalColumnCount()(Code) | | Returns total column counts, including hidden ones.
|
getName | public HsqlName getName()(Code) | | Returns the HsqlName object fo the table
|
getNewColumnCheckList | boolean[] getNewColumnCheckList()(Code) | | Returns empty boolean array.
|
getNewColumnMap | int[] getNewColumnMap()(Code) | | Returns empty mapping array.
|
getNewRowData | Object[] getNewRowData(Session session, boolean[] exists) throws HsqlException(Code) | | Returns array for a new row with SQL DEFAULT value for each column n
where exists[n] is false. This provides default values only where
required and avoids evaluating these values where they will be
overwritten.
|
getNextConstraintIndex | int getNextConstraintIndex(int from, int type)(Code) | | Returns the next constraint of a given type
Parameters: from - Parameters: type - |
getPrimaryConstraint | Constraint getPrimaryConstraint()(Code) | | Returns the primary constraint.
|
getPrimaryIndex | public Index getPrimaryIndex()(Code) | | Returns the primary index (user defined or system defined)
|
getPrimaryKey | public int[] getPrimaryKey()(Code) | | Return the user defined primary key column indexes, or empty array for system PK's.
|
getPrimaryKeyTypes | public int[] getPrimaryKeyTypes()(Code) | | |
getRow | CachedRow getRow(int pos, Node primarynode) throws HsqlException(Code) | | Used by CACHED tables to fetch a Row from the Cache, resulting in the
Row being read from disk if it is not in the Cache.
TEXT tables pass the memory resident Node parameter so that the Row
and its index Nodes can be relinked.
|
getSchemaName | public String getSchemaName()(Code) | | Returns the schema name.
|
getTableType | final public int getTableType()(Code) | | |
getUniqueConstraintForColumns | Constraint getUniqueConstraintForColumns(int[] cols)(Code) | | Returns any unique constraint equivalent to the column set
|
getUniqueConstraintIndexForColumns | Index getUniqueConstraintIndexForColumns(int[] col)(Code) | | Returns the index supporting a constraint with the given column signature.
Only Unique constraints are considered.
|
getUniqueOrPKConstraintForIndex | Constraint getUniqueOrPKConstraintForIndex(Index index)(Code) | | Returns any unique Constraint using this index
Parameters: index - |
hasPrimaryKey | public boolean hasPrimaryKey()(Code) | | |
insert | int insert(Session session, Result ins) throws HsqlException(Code) | | Highest level multiple row insert method. Corresponds to an SQL
INSERT INTO ... SELECT ... statement.
|
insert | void insert(Session session, Object[] data) throws HsqlException(Code) | | Highest level method for inserting a single row. Corresponds to an
SQL INSERT INTO .... VALUES(,,) statement.
fires triggers.
|
insertFromScript | public void insertFromScript(Object[] data) throws HsqlException(Code) | | Not for general use.
Used by ScriptReader to unconditionally insert a row into
the table when the .script file is read.
|
insertFromTextSource | protected void insertFromTextSource(CachedRow row) throws HsqlException(Code) | | Used by TextCache to insert a row into the indexes when the source
file is first read.
|
insertIntoTable | void insertIntoTable(Session session, Result result) throws HsqlException(Code) | | Multi-row insert method. Used for SELECT ... INTO tablename queries.
These tables are new, empty tables, with no constraints, triggers
column default values, column size enforcement whatsoever.
Not used for INSERT INTO .... SELECT ... FROM queries
|
insertNoCheckRollback | void insertNoCheckRollback(Session session, Row row, boolean log) throws HsqlException(Code) | | Low level method for restoring deleted rows
|
insertSys | int insertSys(Result ins) throws HsqlException(Code) | | Used for system table inserts. No checks. No identity
columns.
|
isBestRowIdentifiersStrict | boolean isBestRowIdentifiersStrict()(Code) | | |
isCached | public boolean isCached()(Code) | | True if table is CACHED or TEXT
|
isConnected | public boolean isConnected()(Code) | | determines whether the table is actually connected to the underlying data source.
This method is available for text tables only.
See Also: setDataSource See Also: disconnect See Also: isConnected |
isDataReadOnly | public boolean isDataReadOnly()(Code) | | |
isDescDataSource | protected boolean isDescDataSource()(Code) | | For text tables.
|
isEmpty | public boolean isEmpty(Session session)(Code) | | Returns true if the table has any rows at all.
|
isFileBased | boolean isFileBased()(Code) | | Text or Cached Tables are normally file based
|
isIndexCached | boolean isIndexCached()(Code) | | Returns true if table is CACHED
|
isIndexingMutable | boolean isIndexingMutable()(Code) | | returns false if the table has to be recreated in order to add / drop
indexes. Only CACHED tables return false.
|
isReadOnly | final public boolean isReadOnly()(Code) | | |
isTemp | final public boolean isTemp()(Code) | | |
isText | final public boolean isText()(Code) | | |
isView | final boolean isView()(Code) | | |
isWritable | boolean isWritable()(Code) | | |
mergeKeepUpdate | static boolean mergeKeepUpdate(Session session, HashMappedList rowSet, int[] cols, int[] colTypes, Row row, Object[] newData) throws HsqlException(Code) | | Merge the full triggered change with the updated row, or add to list.
Return false if changes conflict.
|
mergeUpdate | static void mergeUpdate(HashMappedList rowSet, Row row, Object[] newData, int[] cols)(Code) | | Merges a triggered change with a previous triggered change, or adds to
list.
|
moveData | void moveData(Session session, Table from, int colindex, int adjust) throws HsqlException(Code) | | Moves the data from table to table.
The colindex argument is the index of the column that was
added or removed. The adjust argument is {-1 | 0 | +1}
|
moveDefinition | Table moveDefinition(int[] removeIndex, Column newColumn, int colIndex, int adjust) throws HsqlException(Code) | | Constraints that need removing are removed outside this method.
removeIndex is the index of an index to be removed, in which case
no change is made to columns
When withoutindex is null, adjust {-1 | 0 | +1} indicates if a
column is {removed | replaced | added}
|
moveDefinitionPK | Table moveDefinitionPK(int[] pkCols, boolean withIdentity) throws HsqlException(Code) | | cols == null means drop
|
removeConstraint | void removeConstraint(String name)(Code) | | remove a named constraint
|
removeRowFromStore | void removeRowFromStore(Row row) throws HsqlException(Code) | | called in autocommit mode or by transaction manager when a a delete is committed
|
rename | void rename(Session session, String newname, boolean isquoted) throws HsqlException(Code) | | Changes table name. Used by 'alter table rename to'.
Essential to use the existing HsqlName as this is is referenced by
intances of Constraint etc.
|
resetDefaultsFlag | void resetDefaultsFlag()(Code) | | sets the flag for the presence of any default expression
|
resetRowId | public void resetRowId(Session session) throws HsqlException(Code) | | Necessary when over Integer.MAX_VALUE Row objects have been generated
for a memory table.
|
setBestRowIdentifiers | void setBestRowIdentifiers()(Code) | | 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 first one (it doesn't
make any difference to performance).
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.
|
setColumnTypeVars | void setColumnTypeVars(int i)(Code) | | |
setDefaultExpression | void setDefaultExpression(int columnIndex, Expression def)(Code) | | Sets the SQL default value for a columm.
|
setIdentityColumn | protected void setIdentityColumn(Session session, Object[] data) throws HsqlException(Code) | | If there is an identity column (visible or hidden) on the table, sets
the value and/or adjusts the iIdentiy value for the table.
|
setIndexRoots | public void setIndexRoots(int[] roots) throws HsqlException(Code) | | Sets the index roots of a cached/text table to specified file
pointers. If a
file pointer is -1 then the particular index root is null. A null index
root signifies an empty table. Accordingly, all index roots should be
null or all should be a valid file pointer/reference.
|
setIsReadOnly | protected void setIsReadOnly(boolean newReadOnly)(Code) | | sets the isReadOnly flag, and invalidates the database's system tables as needed
|
update | int update(Session session, HashMappedList updateList, int[] cols) throws HsqlException(Code) | | Highest level multiple row update method. Corresponds to an SQL
UPDATE. To DEAL with unique constraints we need to perform all
deletes at once before the inserts. If there is a UNIQUE constraint
violation limited only to the duration of updating multiple rows,
we don't want to abort the operation. Example:
UPDATE MYTABLE SET UNIQUECOL = UNIQUECOL + 1
After performing each cascade update, delete the main row.
After all cascade ops and deletes have been performed, insert new
rows.
The following clauses from SQL Standard section 11.8 are enforced
9) Let ISS be the innermost SQL-statement being executed.
10) If evaluation of these General Rules during the execution of ISS
would cause an update of some site to a value that is distinct from the
value to which that site was previously updated during the execution of
ISS, then an exception condition is raised: triggered data change
violation.
11) If evaluation of these General Rules during the execution of ISS
would cause deletion of a row containing a site that is identified for
replacement in that row, then an exception condition is raised:
triggered data change violation.
(fredt)
|
updateConstraintsTables | void updateConstraintsTables(Session session, Table old, int colindex, int adjust) throws HsqlException(Code) | | Updates the constraint and replaces references to the old table with
the new one, adjusting column index arrays by the given amount.
|
updateIdentityValue | protected void updateIdentityValue(Object[] data) throws HsqlException(Code) | | If there is an identity column (visible or hidden) on the table, sets
the max identity value.
|
|
|