Java Doc for TableWorks.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.TableWorks

TableWorks
class TableWorks (Code)
The methods in this class perform alterations to the structure of an existing table which may result in a new Table object
author:
   fredt@users
version:
   1.8.0
since:
   1.7.0



Constructor Summary
 TableWorks(Session session, Table table)
    

Method Summary
 voidaddColumn(Column column, int colIndex)
    
 voidaddOrDropPrimaryKey(int[] cols, boolean identity)
    
 voidaddPrimaryKey(int[] cols, HsqlName name)
    
 voidcheckConvertColDataType(Column oldCol, Column newCol)
    
 voidcreateCheckConstraint(Constraint c, HsqlName name)
    
 voidcreateForeignKey(int[] fkcol, int[] expcol, HsqlName name, Table mainTable, int deleteAction, int updateAction)
     Creates a foreign key according to current sql.strict_fk or sql.strong_fk settings.
 IndexcreateIndex(int[] col, HsqlName name, boolean unique, boolean constraint, boolean forward)
    
 voidcreateUniqueConstraint(int[] col, HsqlName name)
     A unique constraint relies on a unique indexe on the table.
 voiddropColumn(int colIndex)
    
 voiddropConstraint(String name)
    
 voiddropFKConstraint(Constraint c)
    
 voiddropIndex(String indexname)
     Because of the way indexes and column data are held in memory and on disk, it is necessary to recreate the table when an index is added to a non-empty table.

Originally, this method would break existing foreign keys as the table order in the DB was changed.

 TablegetTable()
    
 voidreTypeColumn(Column oldCol, Column newCol)
    
 voidretypeColumn(Column column, int colindex)
    
 voidsetColDefaultExpression(int colIndex, Expression def)
    
 voidsetColNullability(Column column, boolean nullable)
    


Constructor Detail
TableWorks
TableWorks(Session session, Table table)(Code)




Method Detail
addColumn
void addColumn(Column column, int colIndex) throws HsqlException(Code)

Parameters:
  column -
Parameters:
  colIndex -
throws:
  HsqlException -



addOrDropPrimaryKey
void addOrDropPrimaryKey(int[] cols, boolean identity) throws HsqlException(Code)



addPrimaryKey
void addPrimaryKey(int[] cols, HsqlName name) throws HsqlException(Code)



checkConvertColDataType
void checkConvertColDataType(Column oldCol, Column newCol) throws HsqlException(Code)



createCheckConstraint
void createCheckConstraint(Constraint c, HsqlName name) throws HsqlException(Code)



createForeignKey
void createForeignKey(int[] fkcol, int[] expcol, HsqlName name, Table mainTable, int deleteAction, int updateAction) throws HsqlException(Code)
Creates a foreign key according to current sql.strict_fk or sql.strong_fk settings. Foreign keys are enforced via indexes on both the referencing (child) and referenced (parent) tables.

In versions 1.7.0 and 1.7.1 some non-standard features were supported for compatibility with older databases. These allowed foreign keys to be created without the prior existence of a unique constraint on the referenced columns.

In version 1.7.2, a unique constraint on the referenced columns must exist. The non-unique index on the referencing table is now always created whether or not a PK or unique constraint index on the columns exist. This closes the loopholes opened by the introduction of ALTER TABLE for adding foreign keys. Foriegn keys on temp tables can reference other temp tables with the same rules above. Foreign keys on permanent tables cannot reference temp tables. Duplicate foreign keys are now disallowed. -- The unique index on the referenced table must always belong to a constraint (PK or UNIQUE). Otherwise after a SHUTDOWN and restart the index will not exist at the time of creation of the foreign key when the foreign key is referencing the same table. -- The non-unique index on the referencing table is always created regardless of any existing index. This allows the foreign key constraint to be dropped when required. (fred@users)
Parameters:
  fkcol -
Parameters:
  expcol -
Parameters:
  name - foreign key name
Parameters:
  expTable -
Parameters:
  deleteAction -
Parameters:
  updateAction -
throws:
  HsqlException -




createIndex
Index createIndex(int[] col, HsqlName name, boolean unique, boolean constraint, boolean forward) throws HsqlException(Code)
Because of the way indexes and column data are held in memory and on disk, it is necessary to recreate the table when an index is added to a non-empty table cached table.

With empty tables, Index objects are simply added

With MEOMRY and TEXT tables, a new index is built up and nodes for earch row are interlinked (fredt@users)
Parameters:
  col -
Parameters:
  name -
Parameters:
  unique -
Parameters:
  constraint -
Parameters:
  forward - new index
throws:
  HsqlException - normally for lack of resources




createUniqueConstraint
void createUniqueConstraint(int[] col, HsqlName name) throws HsqlException(Code)
A unique constraint relies on a unique indexe on the table. It can cover a single column or multiple columns.

All unique constraint names are generated by Database.java as unique within the database. Duplicate constraints (more than one unique constriant on the same set of columns are still allowed but the names will be different. (fredt@users)
Parameters:
  col -
Parameters:
  name -
throws:
  HsqlException -




dropColumn
void dropColumn(int colIndex) throws HsqlException(Code)

Parameters:
  colIndex -
throws:
  HsqlException -



dropConstraint
void dropConstraint(String name) throws HsqlException(Code)
Drop a named constraint



dropFKConstraint
void dropFKConstraint(Constraint c) throws HsqlException(Code)



dropIndex
void dropIndex(String indexname) throws HsqlException(Code)
Because of the way indexes and column data are held in memory and on disk, it is necessary to recreate the table when an index is added to a non-empty table.

Originally, this method would break existing foreign keys as the table order in the DB was changed. The new table is now linked in place of the old table (fredt@users)
Parameters:
  indexname -
throws:
  HsqlException -




getTable
Table getTable()(Code)



reTypeColumn
void reTypeColumn(Column oldCol, Column newCol) throws HsqlException(Code)



retypeColumn
void retypeColumn(Column column, int colindex) throws HsqlException(Code)

Parameters:
  column -
Parameters:
  colindex -
throws:
  HsqlException -



setColDefaultExpression
void setColDefaultExpression(int colIndex, Expression def) throws HsqlException(Code)
performs the work for changing the default value of a column



setColNullability
void setColNullability(Column column, boolean nullable) throws HsqlException(Code)
performs the work for changing the nullability of a column



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.