Java Doc for Table.java in  » Database-DBMS » hsql » org » hsqldb » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » hsql » org.hsqldb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

Inner Class :public class RowStore implements PersistentStore

Field Summary
final public static  intCACHED_TABLE
    
final public static  intMEMORY_TABLE
    
final public static  intSYSTEM_SUBQUERY
    
final public static  intSYSTEM_TABLE
    
final static  intSYSTEM_VIEW
    
final public static  intTEMP_TABLE
    
final public static  intTEMP_TEXT_TABLE
    
final public static  intTEXT_TABLE
    
final public static  intVIEW
    
 IndexbestIndex
    
 int[]bestIndexForColumn
    
 int[]bestRowIdentifierCols
    
 booleanbestRowIdentifierStrict
    
protected  DataFileCachecache
    
protected  intcolumnCount
    
public  HashMappedListcolumnList
    
 Constraint[]constraintList
    
 HashSetconstraintPath
     Reusable set of all FK constraints that have so far been enforced while a cascading insert or delete is in progress.
public  Databasedatabase
    
 intidentityColumn
    
 NumberSequenceidentitySequence
    
 Index[]indexList
    
protected  intindexType
    
protected  booleanisCached
    
protected  booleanisLogged
    
protected  booleanisMemory
    
protected  booleanisReadOnly
    
protected  booleanisTemp
    
protected  booleanisText
    
protected  booleanonCommitPreserve
    
 NumberSequencerowIdSequence
    
 PersistentStorerowStore
    
 booleansqlEnforceSize
    
protected  HsqlNametableName
    
 HashMappedListtableUpdateList
     Current list of updates on this table.
 HsqlArrayList[]triggerLists
    

Constructor Summary
 Table(Database db, HsqlName name, int type)
    

Method Summary
 voidaddColumn(Column column)
     Performs the table level checks and adds a column to the table at the DDL level.
 voidaddColumns(Result.ResultMetaData metadata, int count)
    
 voidaddColumns(Select select)
    
 voidaddConstraint(Constraint c)
     Adds a constraint.
 voidaddTrigger(TriggerDef trigDef)
     Adds a trigger.
static  voidcheckCascadeDelete(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  voidcheckCascadeUpdate(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.
 voidcheckColumnInCheckConstraint(String colname)
     Used for drop column.
 voidcheckColumnInFKConstraint(int colIndex)
     Used for retype column.
 voidcheckColumnInFKConstraint(int colIndex, int actionType)
     Used for column defaults and nullability.
 voidcheckColumnsMatch(int[] col, Table other, int[] othercol)
    
 voidcheckDataReadOnly()
    
 voidcheckDropIndex(String indexname, HashSet ignore, boolean dropPK)
     Checks for use of a named index in table constraints, while ignorring a given set of constraints.
 voidcheckRowDataInsert(Session session, Object[] data)
    
 voidcheckRowDataUpdate(Session session, Object[] data, int[] cols)
    
 voidclearAllRows(Session session)
    
static  voidclearUpdateLists(HashMappedList tableUpdateList)
    
 voidcommitRowToStore(Row row)
    
public  voidconnect(Session session)
     connects the table to the underlying data source.

This method is available for text tables only.


Parameters:
  session - denotes the current session.
 IndexcreateIndex(Session session, int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward)
     Create new memory-resident index.
 IndexcreateIndexStructure(int[] columns, HsqlName name, boolean unique, boolean constraint, boolean forward)
     Creates the internal structures for an index.
 intcreateIndexStructureGetNo(int[] column, HsqlName name, boolean unique, boolean constraint, boolean forward)
    
 voidcreatePrimaryIndex(int[] pkcols, HsqlName name)
    
 voidcreatePrimaryKey(int[] cols)
     Shortcut for creating system table PK's.
 voidcreatePrimaryKey()
     Shortcut for creating default PK's.
 voidcreatePrimaryKey(HsqlName indexName, int[] columns, boolean columnsNotNull)
     Creates a single or multi-column primary key and index.
 intdelete(Session session, HsqlArrayList deleteList)
     Highest level multiple row delete method.
public  voiddeleteNoCheckFromLog(Session session, Object[] data)
     For log statements.
 voiddeleteNoCheckRollback(Session session, Row row, boolean log)
     Low level row delete method.
public  voiddisconnect(Session session)
     disconnects the table from the underlying data source.

This method is available for text tables only.


Parameters:
  session - denotes the current session.
 voiddrop()
    
 voiddropIndex(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.
 voiddropIndexFromRows(Session session, int index)
    
 voiddropTrigger(String name)
     Drops a trigger.
 voiddropTriggers()
     Drops all triggers.
protected  Tableduplicate()
     returns a basic duplicate of the table without the data structures.
 voidenforceFieldValueLimits(Object[] data, int[] cols)
     Enforce max field sizes according to SQL column definition.
protected  voidenforceNullConstraints(Object[] data)
     Checks a row against NOT NULL constraints on columns.
 booleanequals(Session session, String name)
    
 booleanequals(String name)
    
 booleanequals(HsqlName name)
    
 intfindColumn(String c)
     Returns the index of given column name or -1 if not found.
 voidfireAll(Session session, int trigVecIndx, Object[] oldrow, Object[] newrow)
    
 voidfireAll(Session session, int trigVecIndex)
     Statement level triggers.
 int[]getBestRowIdentifiers()
    
 DataFileCachegetCache()
    
 StringgetCatalogName()
     Returns the catalog name or null, depending on a database property.
 ColumngetColumn(int i)
    
public  intgetColumnCount()
     Returns the count of user defined columns.
 int[]getColumnMap()
     Returns direct mapping array.
 intgetColumnNr(String c)
    
public  int[]getColumnTypes()
    
 ConstraintgetConstraint(String constraintName)
    
 ConstraintgetConstraintForColumns(Table tablemain, int[] colmain, int[] colref)
    
 intgetConstraintIndex(String constraintName)
    
 Constraint[]getConstraints()
     Returns the list of constraints.
protected  StringgetDataSource()
    
public  Object[]getEmptyRowData()
     Returns empty Object array for a new row.
public  StringgetHeader()
     For text tables.
public  intgetId()
    
 intgetIdentityColumn()
     Returns the identity column or null.
 IndexgetIndex(int[] exclude, int colIndex)
    
 IndexgetIndex(String indexName)
     Returns the Index object of the given name or null if not found.
public  IndexgetIndex(int i)
    
public  intgetIndexCount()
     Returns the count of indexes on this table.
 IndexgetIndexForColumn(Session session, int column)
     Used in TableFilter to get an index for the column.
 IndexgetIndexForColumns(boolean[] columnCheck)
    
 IndexgetIndexForColumns(int[] col, boolean unique)
    
 intgetIndexIndex(String indexName)
     Returns the index of the Index object of the given name or -1 if not found.
 StringgetIndexRoots()
     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  intgetIndexType()
    
public  Index[]getIndexes()
    
 intgetInternalColumnCount()
     Returns total column counts, including hidden ones.
public  HsqlNamegetName()
    
 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.
 intgetNextConstraintIndex(int from, int type)
    
 ConstraintgetPrimaryConstraint()
     Returns the primary constraint.
public  IndexgetPrimaryIndex()
    
public  int[]getPrimaryKey()
     Return the user defined primary key column indexes, or empty array for system PK's.
public  int[]getPrimaryKeyTypes()
    
 CachedRowgetRow(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.
 CachedRowgetRow(int pos)
    
 CachedRowgetRow(long id)
    
public  intgetRowCount(Session session)
    
public  StringgetSchemaName()
     Returns the schema name.
final public  intgetTableType()
    
 ConstraintgetUniqueConstraintForColumns(int[] cols)
    
 IndexgetUniqueConstraintIndexForColumns(int[] col)
     Returns the index supporting a constraint with the given column signature.
 ConstraintgetUniqueOrPKConstraintForIndex(Index index)
    
public  booleanhasPrimaryKey()
    
 voidindexRow(Session session, Row row)
    
 intinsert(Session session, Result ins)
     Highest level multiple row insert method.
 voidinsert(Session session, Object[] data)
     Highest level method for inserting a single row.
public  voidinsertData(Session session, Object[] data)
     Used by the methods above.
public  voidinsertFromScript(Object[] data)
     Not for general use.
protected  voidinsertFromTextSource(CachedRow row)
     Used by TextCache to insert a row into the indexes when the source file is first read.
 voidinsertIntoTable(Session session, Result result)
     Multi-row insert method.
public  voidinsertNoCheckFromLog(Session session, Object[] data)
    
 voidinsertNoCheckRollback(Session session, Row row, boolean log)
    
 intinsertResult(Session session, Result ins)
     Used for subquery inserts.
 intinsertSys(Result ins)
     Used for system table inserts.
public  voidinsertSys(Object[] data)
    
 booleanisBestRowIdentifiersStrict()
    
public  booleanisCached()
    
public  booleanisConnected()
     determines whether the table is actually connected to the underlying data source.
public  booleanisDataReadOnly()
    
protected  booleanisDescDataSource()
     For text tables.
public  booleanisEmpty(Session session)
     Returns true if the table has any rows at all.
 booleanisFileBased()
    
 booleanisIndexCached()
    
 booleanisIndexingMutable()
     returns false if the table has to be recreated in order to add / drop indexes.
final public  booleanisReadOnly()
    
final public  booleanisTemp()
    
final public  booleanisText()
    
final  booleanisView()
    
 booleanisWritable()
    
 HsqlNamemakeSysPKName()
    
static  booleanmergeKeepUpdate(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  voidmergeUpdate(HashMappedList rowSet, Row row, Object[] newData, int[] cols)
     Merges a triggered change with a previous triggered change, or adds to list.
 voidmoveData(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.
 TablemoveDefinition(int[] removeIndex, Column newColumn, int colIndex, int adjust)
    
 TablemoveDefinitionPK(int[] pkCols, boolean withIdentity)
    
 RownewRow(Object[] o)
     Factory method instantiates a Row based on table type.
 voidreleaseRowFromStore(Row row)
    
 voidremoveConstraint(String name)
    
 voidremoveRowFromStore(Row row)
    
 voidrename(Session session, String newname, boolean isquoted)
     Changes table name.
 voidrenameColumn(Column column, String newName, boolean isquoted)
    
 voidresetDefaultsFlag()
    
public  voidresetRowId(Session session)
     Necessary when over Integer.MAX_VALUE Row objects have been generated for a memory table.
 RowrestoreRow(Row oldrow)
    
 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. (a) gives most weight to a primary key index, followed by a unique address with the lowest count of nullable columns.
 voidsetColumnTypeVars(int i)
    
 voidsetDataReadOnly(boolean value)
    
protected  voidsetDataSource(Session s, String source, boolean isDesc, boolean newFile)
    
 voidsetDefaultExpression(int columnIndex, Expression def)
     Sets the SQL default value for a columm.
public  voidsetHeader(String header)
     For text tables.
protected  voidsetIdentityColumn(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  voidsetIndexRoots(int[] roots)
     Sets the index roots of a cached/text table to specified file pointers.
 voidsetIndexRoots(String s)
     Sets the index roots and next identity.
protected  voidsetIsReadOnly(boolean newReadOnly)
    
 intupdate(Session session, HashMappedList updateList, int[] cols)
     Highest level multiple row update method.
 voidupdateConstraintsTables(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  voidupdateIdentityValue(Object[] data)
     If there is an identity column (visible or hidden) on the table, sets the max identity value.
 voidupdateRowSet(Session session, HashMappedList rowSet, int[] cols, boolean nodelete)
    

Field Detail
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)



bestIndex
Index bestIndex(Code)



bestIndexForColumn
int[] bestIndexForColumn(Code)



bestRowIdentifierCols
int[] bestRowIdentifierCols(Code)



bestRowIdentifierStrict
boolean bestRowIdentifierStrict(Code)



cache
protected DataFileCache cache(Code)



columnCount
protected int columnCount(Code)



columnList
public HashMappedList columnList(Code)



constraintList
Constraint[] constraintList(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.



database
public Database database(Code)



identityColumn
int identityColumn(Code)



identitySequence
NumberSequence identitySequence(Code)



indexList
Index[] indexList(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)



rowIdSequence
NumberSequence rowIdSequence(Code)



rowStore
PersistentStore rowStore(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.



triggerLists
HsqlArrayList[] triggerLists(Code)




Constructor Detail
Table
Table(Database db, HsqlName name, int type) throws HsqlException(Code)
Constructor
Parameters:
  db -
Parameters:
  name -
Parameters:
  type -
Parameters:
  sessionid -
exception:
  HsqlException -




Method Detail
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.



addColumns
void addColumns(Result.ResultMetaData metadata, int count) throws HsqlException(Code)
Add a set of columns based on a ResultMetaData



addColumns
void addColumns(Select select) throws HsqlException(Code)
Adds a set of columns based on a compiled Select



addConstraint
void addConstraint(Constraint c)(Code)
Adds a constraint.



addTrigger
void addTrigger(TriggerDef trigDef)(Code)
Adds a trigger.



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



checkRowDataInsert
void checkRowDataInsert(Session session, Object[] data) throws HsqlException(Code)



checkRowDataUpdate
void checkRowDataUpdate(Session session, Object[] data, int[] cols) throws HsqlException(Code)



clearAllRows
void clearAllRows(Session session)(Code)



clearUpdateLists
static void clearUpdateLists(HashMappedList tableUpdateList)(Code)



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)



delete
int delete(Session session, HsqlArrayList deleteList) throws HsqlException(Code)
Highest level multiple row delete method. Corresponds to an SQL DELETE.



deleteNoCheckFromLog
public void deleteNoCheckFromLog(Session session, Object[] data) throws HsqlException(Code)
For log statements.



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



drop
void drop() throws HsqlException(Code)



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.



dropIndexFromRows
void dropIndexFromRows(Session session, int index) throws HsqlException(Code)



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(Session session, String name)(Code)



equals
boolean equals(String name)(Code)



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)



getCache
DataFileCache getCache()(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



getConstraint
Constraint getConstraint(String constraintName)(Code)
return the named constriant



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.



getHeader
public String getHeader()(Code)
For text tables.



getId
public int getId()(Code)



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)



getIndexes
public Index[] getIndexes()(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.



getRow
CachedRow getRow(int pos)(Code)
As above, only for CACHED tables



getRow
CachedRow getRow(long id)(Code)
As above, only for CACHED tables



getRowCount
public int getRowCount(Session session) throws HsqlException(Code)



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)



indexRow
void indexRow(Session session, Row row) throws HsqlException(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.



insertData
public void insertData(Session session, Object[] data) throws HsqlException(Code)
Used by the methods above.



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



insertNoCheckFromLog
public void insertNoCheckFromLog(Session session, Object[] data) throws HsqlException(Code)



insertNoCheckRollback
void insertNoCheckRollback(Session session, Row row, boolean log) throws HsqlException(Code)
Low level method for restoring deleted rows



insertResult
int insertResult(Session session, Result ins) throws HsqlException(Code)
Used for subquery inserts. No checks. No identity columns.



insertSys
int insertSys(Result ins) throws HsqlException(Code)
Used for system table inserts. No checks. No identity columns.



insertSys
public void insertSys(Object[] data) throws HsqlException(Code)
Used by the system tables



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)



makeSysPKName
HsqlName makeSysPKName() throws HsqlException(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



newRow
Row newRow(Object[] o) throws HsqlException(Code)
Factory method instantiates a Row based on table type.



releaseRowFromStore
void releaseRowFromStore(Row row) throws HsqlException(Code)



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.



renameColumn
void renameColumn(Column column, String newName, boolean isquoted) throws HsqlException(Code)



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.



restoreRow
Row restoreRow(Row oldrow) throws HsqlException(Code)



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)



setDataReadOnly
void setDataReadOnly(boolean value) throws HsqlException(Code)



setDataSource
protected void setDataSource(Session s, String source, boolean isDesc, boolean newFile) throws HsqlException(Code)
For text tables



setDefaultExpression
void setDefaultExpression(int columnIndex, Expression def)(Code)
Sets the SQL default value for a columm.



setHeader
public void setHeader(String header) throws HsqlException(Code)
For text tables.



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.



setIndexRoots
void setIndexRoots(String s) throws HsqlException(Code)
Sets the index roots and next identity.



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.



updateRowSet
void updateRowSet(Session session, HashMappedList rowSet, int[] cols, boolean nodelete) throws HsqlException(Code)



Methods inherited from org.hsqldb.BaseTable
abstract Index getPrimaryIndex()(Code)(Java Doc)
public RowIterator rowIterator(Session session) throws HsqlException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.