Java Doc for TableDataConglomerate.java in  » Database-DBMS » mckoi » com » mckoi » database » 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 » mckoi » com.mckoi.database 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mckoi.database.TableDataConglomerate

TableDataConglomerate
public class TableDataConglomerate (Code)
A conglomerate of data that represents the contents of all tables in a complete database. This object handles all data persistance management (storage, retrieval, removal) issues. It is a transactional manager for both data and indices in the database.
author:
   Tobias Downer


Field Summary
final public static  TableNameCHECK_INFO_TABLE
    
final public static  TableNameFOREIGN_COLS_TABLE
    
final public static  TableNameFOREIGN_INFO_TABLE
    
final public static  TableNamePERSISTENT_VAR_TABLE
    
final public static  TableNamePRIMARY_COLS_TABLE
    
final public static  TableNamePRIMARY_INFO_TABLE
    
final public static  TableNameSCHEMA_INFO_TABLE
     The schema info table.
final public static  StringSTATE_POST
     The postfix on the name of the state file for the database store name.
final public static  StringSYSTEM_SCHEMA
     The name of the system schema where persistant conglomerate state is stored.
final public static  TableNameSYS_SEQUENCE
    
final public static  TableNameSYS_SEQUENCE_INFO
    
final public static  TableNameUNIQUE_COLS_TABLE
    
final public static  TableNameUNIQUE_INFO_TABLE
    
final  Objectcommit_lock
     This lock is obtained when we go to commit a change to the table.

Constructor Summary
public  TableDataConglomerate(TransactionSystem system, StoreSystem store_system)
     Constructs the conglomerate.

Method Summary
final public  DebugLoggerDebug()
     Returns the DebugLogger object that we use to log debug messages to.
public  voidaddTransactionModificationListener(TableName table_name, TransactionModificationListener listener)
     Adds a listener for transactional modification events that occur on the given table in this conglomerate.
static  voidcheckAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices, short deferred)
     Performs constraint violation checks on an addition of the given set of row indices into the TableDataSource in the given transaction.
static  voidcheckAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, int row_index, short deferred)
     Performs constraint violation checks on an addition of the given row index into the TableDataSource in the given transaction.
static  voidcheckAllAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, short deferred)
     Performs constraint violation checks on all the rows in the given table.
static  voidcheckFieldConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices)
     Checks that the nullibility and class of the fields in the given rows are valid.
static  voidcheckRemoveConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices, short deferred)
     Performs constraint violation checks on a removal of the given set of row indexes from the TableDataSource in the given transaction.
static  voidcheckRemoveConstraintViolations(SimpleTransaction transaction, TableDataSource table, int row_index, short deferred)
     Performs constraint violation checks on a removal of the given row index from the TableDataSource in the given transaction.
public  voidcheckVisibleTables(UserTerminal terminal)
     Checks the list of committed tables in this conglomerate.
public  voidclose()
     Closes this conglomerate.
 MasterTableDataSourcecopyMasterTable(MasterTableDataSource src_master_table, IndexSet index_set)
     Creates a table store in this conglomerate that is an exact copy of the given MasterTableDataSource.
public  voidcreate(String name)
     Creates a new conglomerate at the given path in the file system.
 MasterTableDataSourcecreateMasterTable(DataTableDef table_def, int data_sector_size, int index_sector_size)
     Creates a table store in this conglomerate with the given name and returns a reference to the table.
 RefcreateNewLargeObject(byte type, long size)
     Creates and allocates storage for a new large object in the blob store.
public  TransactioncreateTransaction()
     Starts a new transaction.
static  StringdeferredString(short deferred)
     Convenience, returns either 'Immediate' or 'Deferred' dependant on the deferred short.
public  voiddelete()
     Deletes and closes the conglomerate.
public  booleanexists(String name)
     Returns true if the conglomerate exists in the file system and can be opened.
public  voidfinalize()
    
static  int[]findColumnIndices(DataTableDef table_def, String[] cols)
     Returns a list of column indices into the given DataTableDef for the given column names.
static  IntegerVectorfindKeys(TableDataSource t2, int[] col2_indexes, TObject[] key_value)
     Returns the key indices found in the given table.
public  voidfix(String name, UserTerminal terminal)
     Checks the conglomerate state file.
 voidflushBlobStore()
     Called when one or more blobs has been completed.
public  String[]getAllTableFileNames()
     Returns the list of file names for all tables in this conglomerate.
final  BlobStoregetBlobStore()
     Returns the BlobStore for this conglomerate.
public  RawDiagnosticTablegetDiagnosticTable(String table_file_name)
     Returns a RawDiagnosticTable object that is used for diagnostics of the table with the given file name.
 MasterTableDataSourcegetMasterTable(int table_id)
     Returns the MasterTableDataSource in this conglomerate with the given table id.
 StringgetName()
     Returns the name given to this conglomerate.
final  SequenceManagergetSequenceManager()
     Returns the SequenceManager object for this conglomerate.
final public  TransactionSystemgetSystem()
     Returns the TransactionSystem that this conglomerate is part of.
public  booleanisClosed()
     Returns true if the conglomerate is closed.
public  voidliveCopyTo(TableDataConglomerate dest_conglomerate)
     Makes a complete copy of this database to the position represented by the given TableDataConglomerate object.
 voidminimalCreate(String name)
     Minimally creates a new conglomerate but does NOT initialize any of the system tables.
public  voidopen(String name)
     Opens a conglomerate.
 voidprocessCommit(Transaction transaction, ArrayList visible_tables, ArrayList selected_from_tables, ArrayList touched_tables, TransactionJournal journal)
     Tries to commit a transaction to the conglomerate.
 voidprocessRollback(Transaction transaction, ArrayList touched_tables, TransactionJournal journal)
     Rollbacks a transaction and invalidates any changes that the transaction made to the database.
public  voidremoveTransactionModificationListener(TableName table_name, TransactionModificationListener listener)
     Removes a listener for transaction modification events on the given table in this conglomerate as previously set by the 'addTransactionModificationListener' method.
 voidresetAllSystemTableID()
     Resets the table sequence id for all the system tables managed by the conglomerate.
 voidresetTableID(TableName tname)
     Given a table with a 'id' field, this will check that the sequence value for the table is at least greater than the maximum id in the column.
final public  StoreSystemstoreSystem()
     Returns the StoreSystem used by this conglomerate to manage the persistent state of the database.
static  StringstringColumnList(String[] list)
     Convenience, converts a String[] array to a comma deliminated string list.
 voidupdateSystemTableSchema()
     Create the system tables that must be present in a conglomerates.

Field Detail
CHECK_INFO_TABLE
final public static TableName CHECK_INFO_TABLE(Code)



FOREIGN_COLS_TABLE
final public static TableName FOREIGN_COLS_TABLE(Code)



FOREIGN_INFO_TABLE
final public static TableName FOREIGN_INFO_TABLE(Code)



PERSISTENT_VAR_TABLE
final public static TableName PERSISTENT_VAR_TABLE(Code)



PRIMARY_COLS_TABLE
final public static TableName PRIMARY_COLS_TABLE(Code)



PRIMARY_INFO_TABLE
final public static TableName PRIMARY_INFO_TABLE(Code)



SCHEMA_INFO_TABLE
final public static TableName SCHEMA_INFO_TABLE(Code)
The schema info table.



STATE_POST
final public static String STATE_POST(Code)
The postfix on the name of the state file for the database store name.



SYSTEM_SCHEMA
final public static String SYSTEM_SCHEMA(Code)
The name of the system schema where persistant conglomerate state is stored.



SYS_SEQUENCE
final public static TableName SYS_SEQUENCE(Code)



SYS_SEQUENCE_INFO
final public static TableName SYS_SEQUENCE_INFO(Code)



UNIQUE_COLS_TABLE
final public static TableName UNIQUE_COLS_TABLE(Code)



UNIQUE_INFO_TABLE
final public static TableName UNIQUE_INFO_TABLE(Code)



commit_lock
final Object commit_lock(Code)
This lock is obtained when we go to commit a change to the table. Grabbing this lock ensures that no other commits can occur at the same time on this conglomerate.




Constructor Detail
TableDataConglomerate
public TableDataConglomerate(TransactionSystem system, StoreSystem store_system)(Code)
Constructs the conglomerate.




Method Detail
Debug
final public DebugLogger Debug()(Code)
Returns the DebugLogger object that we use to log debug messages to.



addTransactionModificationListener
public void addTransactionModificationListener(TableName table_name, TransactionModificationListener listener)(Code)
Adds a listener for transactional modification events that occur on the given table in this conglomerate. A transactional modification event is an event fired immediately upon the modification of a table by a transaction, either immediately before the modification or immediately after. Also an event is fired when a modification to a table is successfully committed.

The BEFORE_* type triggers are given the opportunity to modify the contents of the RowData before the update or insert occurs. All triggers may generate an exception which will cause the transaction to rollback.

The event carries with it the event type, the transaction that the event occurred in, and any information regarding the modification itself.

This event/listener mechanism is intended to be used to implement higher layer database triggering systems. Note that care must be taken with the commit level events because they occur inside a commit lock on this conglomerate and so synchronization and deadlock issues need to be carefully considered.

NOTE: A listener on the given table will be notified of ALL table modification events by all transactions at the time they happen.
Parameters:
  table_name - the name of the table in the conglomerate to listen forevents from.
Parameters:
  listener - the listener to be notified of events.




checkAddConstraintViolations
static void checkAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices, short deferred)(Code)
Performs constraint violation checks on an addition of the given set of row indices into the TableDataSource in the given transaction. If a violation is detected a DatabaseConstraintViolationException is thrown.

If deferred = IMMEDIATE only immediate constraints are tested. If deferred = DEFERRED all constraints are tested.
Parameters:
  transaction - the Transaction instance used to determine tableconstraints.
Parameters:
  table - the table to test
Parameters:
  row_indices - the list of rows that were added to the table.
Parameters:
  deferred - '1' indicates Transaction.IMMEDIATE,'2' indicates Transaction.DEFERRED.




checkAddConstraintViolations
static void checkAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, int row_index, short deferred)(Code)
Performs constraint violation checks on an addition of the given row index into the TableDataSource in the given transaction. If a violation is detected a DatabaseConstraintViolationException is thrown.

If deferred = IMMEDIATE only immediate constraints are tested. If deferred = DEFERRED all constraints are tested.
Parameters:
  transaction - the Transaction instance used to determine tableconstraints.
Parameters:
  table - the table to test
Parameters:
  row_index - the row that was added to the table.
Parameters:
  deferred - '1' indicates Transaction.IMMEDIATE,'2' indicates Transaction.DEFERRED.




checkAllAddConstraintViolations
static void checkAllAddConstraintViolations(SimpleTransaction transaction, TableDataSource table, short deferred)(Code)
Performs constraint violation checks on all the rows in the given table. If a violation is detected a DatabaseConstraintViolationException is thrown.

This method is useful when the constraint schema of a table changes and we need to check existing data in a table is conformant with the new constraint changes.

If deferred = IMMEDIATE only immediate constraints are tested. If deferred = DEFERRED all constraint are tested.




checkFieldConstraintViolations
static void checkFieldConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices)(Code)
Checks that the nullibility and class of the fields in the given rows are valid. Should be used as part of the insert procedure.



checkRemoveConstraintViolations
static void checkRemoveConstraintViolations(SimpleTransaction transaction, TableDataSource table, int[] row_indices, short deferred)(Code)
Performs constraint violation checks on a removal of the given set of row indexes from the TableDataSource in the given transaction. If a violation is detected a DatabaseConstraintViolationException is thrown.

If deferred = IMMEDIATE only immediate constraints are tested. If deferred = DEFERRED all constraints are tested.
Parameters:
  transaction - the Transaction instance used to determine tableconstraints.
Parameters:
  table - the table to test
Parameters:
  row_indices - the set of rows that were removed from the table.
Parameters:
  deferred - '1' indicates Transaction.IMMEDIATE,'2' indicates Transaction.DEFERRED.




checkRemoveConstraintViolations
static void checkRemoveConstraintViolations(SimpleTransaction transaction, TableDataSource table, int row_index, short deferred)(Code)
Performs constraint violation checks on a removal of the given row index from the TableDataSource in the given transaction. If a violation is detected a DatabaseConstraintViolationException is thrown.

If deferred = IMMEDIATE only immediate constraints are tested. If deferred = DEFERRED all constraints are tested.
Parameters:
  transaction - the Transaction instance used to determine tableconstraints.
Parameters:
  table - the table to test
Parameters:
  row_index - the row that was removed from the table.
Parameters:
  deferred - '1' indicates Transaction.IMMEDIATE,'2' indicates Transaction.DEFERRED.




checkVisibleTables
public void checkVisibleTables(UserTerminal terminal) throws IOException(Code)
Checks the list of committed tables in this conglomerate. This should only be called during an 'check' like method. This method fills the 'committed_tables' and 'table_list' lists with the tables in this conglomerate.



close
public void close() throws IOException(Code)
Closes this conglomerate. The conglomerate must be open for it to be closed. When closed, any use of this object is undefined.



copyMasterTable
MasterTableDataSource copyMasterTable(MasterTableDataSource src_master_table, IndexSet index_set)(Code)
Creates a table store in this conglomerate that is an exact copy of the given MasterTableDataSource. Note that this table is not a commited change to the system. It is a free standing blank table store. The table returned here is uncommitted and will be deleted unless it is committed.

Note that two tables may exist within a conglomerate with the same name, however each committed table must have a unique name.


Parameters:
  src_master_table - the source master table to copy.
Parameters:
  index_set - the view of the table index to copy. the MasterTableDataSource with the copied information.




create
public void create(String name) throws IOException(Code)
Creates a new conglomerate at the given path in the file system. This must be an empty directory where files can be stored. This will create the conglomerate and exit in an open (read/write) state.



createMasterTable
MasterTableDataSource createMasterTable(DataTableDef table_def, int data_sector_size, int index_sector_size)(Code)
Creates a table store in this conglomerate with the given name and returns a reference to the table. Note that this table is not a commited change to the system. It is a free standing blank table store. The table returned here is uncommitted and will be deleted unless it is committed.

Note that two tables may exist within a conglomerate with the same name, however each committed table must have a unique name.


Parameters:
  table_def - the table definition.
Parameters:
  data_sector_size - the size of the data sectors (affects performanceand size of the file).
Parameters:
  index_sector_size - the size of the index sectors.




createNewLargeObject
Ref createNewLargeObject(byte type, long size)(Code)
Creates and allocates storage for a new large object in the blob store. This is called to create a new large object before filling it with data sent from the client.



createTransaction
public Transaction createTransaction()(Code)
Starts a new transaction. The Transaction object returned by this method is used to read the contents of the database at the time the transaction was started. It is also used if any modifications are required to be made.



deferredString
static String deferredString(short deferred)(Code)
Convenience, returns either 'Immediate' or 'Deferred' dependant on the deferred short.



delete
public void delete() throws IOException(Code)
Deletes and closes the conglomerate. This will delete all the files in the file system associated with this conglomerate, so this method should be used with care.

WARNING: Will result in total loss of all data stored in the conglomerate.




exists
public boolean exists(String name) throws IOException(Code)
Returns true if the conglomerate exists in the file system and can be opened.



finalize
public void finalize()(Code)



findColumnIndices
static int[] findColumnIndices(DataTableDef table_def, String[] cols)(Code)
Returns a list of column indices into the given DataTableDef for the given column names.



findKeys
static IntegerVector findKeys(TableDataSource t2, int[] col2_indexes, TObject[] key_value)(Code)
Returns the key indices found in the given table. The keys are in the given column indices, and the key is in the 'key' array. This can be used to count the number of keys found in a table for constraint violation checking.



fix
public void fix(String name, UserTerminal terminal)(Code)
Checks the conglomerate state file. The returned ErrorState object contains information about any error generated.



flushBlobStore
void flushBlobStore()(Code)
Called when one or more blobs has been completed. This flushes the blob to the blob store and completes the blob write procedure. It's important this is called otherwise the BlobStore may not be correctly flushed to disk with the changes and the data will not be recoverable if a crash occurs.



getAllTableFileNames
public String[] getAllTableFileNames()(Code)
Returns the list of file names for all tables in this conglomerate.



getBlobStore
final BlobStore getBlobStore()(Code)
Returns the BlobStore for this conglomerate.



getDiagnosticTable
public RawDiagnosticTable getDiagnosticTable(String table_file_name)(Code)
Returns a RawDiagnosticTable object that is used for diagnostics of the table with the given file name.



getMasterTable
MasterTableDataSource getMasterTable(int table_id)(Code)
Returns the MasterTableDataSource in this conglomerate with the given table id.



getName
String getName()(Code)
Returns the name given to this conglomerate.



getSequenceManager
final SequenceManager getSequenceManager()(Code)
Returns the SequenceManager object for this conglomerate.



getSystem
final public TransactionSystem getSystem()(Code)
Returns the TransactionSystem that this conglomerate is part of.



isClosed
public boolean isClosed()(Code)
Returns true if the conglomerate is closed.



liveCopyTo
public void liveCopyTo(TableDataConglomerate dest_conglomerate) throws IOException(Code)
Makes a complete copy of this database to the position represented by the given TableDataConglomerate object. The given TableDataConglomerate object must NOT be being used by another database running in the JVM. This may take a while to complete. The backup operation occurs within its own transaction and the copy transaction is read-only meaning there is no way for the copy process to interfere with other transactions running concurrently.

The conglomerate must be open before this method is called.




minimalCreate
void minimalCreate(String name) throws IOException(Code)
Minimally creates a new conglomerate but does NOT initialize any of the system tables. This is a useful feature for a copy function that requires a TableDataConglomerate object to copy data into but does not require any initial system tables (because this information is copied from the source conglomerate.



open
public void open(String name) throws IOException(Code)
Opens a conglomerate. If the conglomerate does not exist then an IOException is generated. Once a conglomerate is open, we may start opening transactions and altering the data within it.



processCommit
void processCommit(Transaction transaction, ArrayList visible_tables, ArrayList selected_from_tables, ArrayList touched_tables, TransactionJournal journal) throws TransactionException(Code)
Tries to commit a transaction to the conglomerate. This is called by the 'closeAndCommit' method in Transaction. An overview of how this works follows:
  • Determine if any transactions have been committed since this transaction was created.
  • If no transactions committed then commit this transaction and exit.
  • Otherwise, determine the tables that have been changed by the committed transactions since this was created.
  • If no tables changed in the tables changed by this transaction then commit this transaction and exit.
  • Determine if there are any rows that have been deleted that this transaction read/deleted.
  • If there are then rollback this transaction and throw an error.
  • Determine if any rows have been added to the tables this transaction read/changed.
  • If there are then rollback this transaction and throw an error.
  • Otherwise commit the transaction.

Parameters:
  transaction - the transaction to commit from.
Parameters:
  visible_tables - the list of visible tables at the end of the commit(MasterTableDataSource)
Parameters:
  selected_from_tables - ths list of tables that this transactionperformed 'select' like queries on (MasterTableDataSource)
Parameters:
  touched_tables - the list of tables touched by the transaction(MutableTableDataSource)
Parameters:
  journal - the journal that describes all the changes within thetransaction.



processRollback
void processRollback(Transaction transaction, ArrayList touched_tables, TransactionJournal journal)(Code)
Rollbacks a transaction and invalidates any changes that the transaction made to the database. The rows that this transaction changed are given up as freely available rows. This is called by the 'closeAndRollback' method in Transaction.



removeTransactionModificationListener
public void removeTransactionModificationListener(TableName table_name, TransactionModificationListener listener)(Code)
Removes a listener for transaction modification events on the given table in this conglomerate as previously set by the 'addTransactionModificationListener' method.
Parameters:
  table_name - the name of the table in the conglomerate to remove fromthe listener list.
Parameters:
  listener - the listener to be removed.



resetAllSystemTableID
void resetAllSystemTableID()(Code)
Resets the table sequence id for all the system tables managed by the conglomerate.



resetTableID
void resetTableID(TableName tname)(Code)
Given a table with a 'id' field, this will check that the sequence value for the table is at least greater than the maximum id in the column.



storeSystem
final public StoreSystem storeSystem()(Code)
Returns the StoreSystem used by this conglomerate to manage the persistent state of the database.



stringColumnList
static String stringColumnList(String[] list)(Code)
Convenience, converts a String[] array to a comma deliminated string list.



updateSystemTableSchema
void updateSystemTableSchema()(Code)
Create the system tables that must be present in a conglomerates. These tables consist of contraint and table management data.

 sUSRPKeyInfo - Primary key constraint information.
 sUSRFKeyInfo - Foreign key constraint information.
 sUSRUniqueInfo - Unique set constraint information.
 sUSRCheckInfo  - Check constraint information.
 sUSRPrimaryColumns - Primary columns information (refers to PKeyInfo)
 sUSRUniqueColumns  - Unique columns information (refers to UniqueInfo)
 sUSRForeignColumns1 - Foreign column information (refers to FKeyInfo)
 sUSRForeignColumns2 - Secondary Foreign column information (refers to
 FKeyInfo).
 
These tables handle data for referential integrity. There are also some additional tables containing general table information.
 sUSRTableColumnInfo - All table and column information.
 
The design is fairly elegant in that we are using the database to store information to maintain referential integrity.

 The schema layout for these tables;
 CREATE TABLE sUSRPKeyInfo (
 id          NUMERIC NOT NULL,
 name        TEXT NOT NULL,  // The name of the primary key constraint
 schema      TEXT NOT NULL,  // The name of the schema
 table       TEXT NOT NULL,  // The name of the table
 deferred    BIT  NOT NULL,  // Whether deferred or immediate
 PRIMARY KEY (id),
 UNIQUE (schema, table)
 );
 CREATE TABLE sUSRFKeyInfo (
 id          NUMERIC NOT NULL,
 name        TEXT NOT NULL,  // The name of the foreign key constraint
 schema      TEXT NOT NULL,  // The name of the schema
 table       TEXT NOT NULL,  // The name of the table
 ref_schema  TEXT NOT NULL,  // The name of the schema referenced
 ref_table   TEXT NOT NULL,  // The name of the table referenced
 update_rule TEXT NOT NULL,  // The rule for updating to table
 delete_rule TEXT NOT NULL,  // The rule for deleting from table
 deferred    BIT  NOT NULL,  // Whether deferred or immediate
 PRIMARY KEY (id)
 );
 CREATE TABLE sUSRUniqueInfo (
 id          NUMERIC NOT NULL,
 name        TEXT NOT NULL,  // The name of the unique constraint
 schema      TEXT NOT NULL,  // The name of the schema
 table       TEXT NOT NULL,  // The name of the table
 deferred    BIT  NOT NULL,  // Whether deferred or immediate
 PRIMARY KEY (id)
 );
 CREATE TABLE sUSRCheckInfo (
 id          NUMERIC NOT NULL,
 name        TEXT NOT NULL,  // The name of the check constraint
 schema      TEXT NOT NULL,  // The name of the schema
 table       TEXT NOT NULL,  // The name of the table
 expression  TEXT NOT NULL,  // The check expression
 deferred    BIT  NOT NULL,  // Whether deferred or immediate
 PRIMARY KEY (id)
 );
 CREATE TABLE sUSRPrimaryColumns (
 pk_id   NUMERIC NOT NULL, // The primary key constraint id
 column  TEXT NOT NULL,    // The name of the primary
 seq_no  INTEGER NOT NULL, // The sequence number of this constraint
 FOREIGN KEY pk_id REFERENCES sUSRPKeyInfo
 );
 CREATE TABLE sUSRUniqueColumns (
 un_id   NUMERIC NOT NULL, // The unique constraint id
 column  TEXT NOT NULL,    // The column that is unique
 seq_no  INTEGER NOT NULL, // The sequence number of this constraint
 FOREIGN KEY un_id REFERENCES sUSRUniqueInfo
 );
 CREATE TABLE sUSRForeignColumns (
 fk_id   NUMERIC NOT NULL, // The foreign key constraint id
 fcolumn TEXT NOT NULL,    // The column in the foreign key
 pcolumn TEXT NOT NULL,    // The column in the primary key
 // (referenced)
 seq_no  INTEGER NOT NULL, // The sequence number of this constraint
 FOREIGN KEY fk_id REFERENCES sUSRFKeyInfo
 );
 CREATE TABLE sUSRSchemaInfo (
 id     NUMERIC NOT NULL,
 name   TEXT NOT NULL,
 type   TEXT,              // Schema type (system, etc)
 other  TEXT,
 UNIQUE ( name )
 );
 CREATE TABLE sUSRTableInfo (
 id     NUMERIC NOT NULL,
 name   TEXT NOT NULL,     // The name of the table
 schema TEXT NOT NULL,     // The name of the schema of this table
 type   TEXT,              // Table type (temporary, system, etc)
 other  TEXT,              // Notes, etc
 UNIQUE ( name )
 );
 CREATE TABLE sUSRColumnColumns (
 t_id    NUMERIC NOT NULL,  // Foreign key to sUSRTableInfo
 column  TEXT NOT NULL,     // The column name
 seq_no  INTEGER NOT NULL,  // The sequence in the table
 type    TEXT NOT NULL,     // The SQL type of this column
 size    NUMERIC,           // The size of the column if applicable
 scale   NUMERIC,           // The scale of the column if applicable
 default TEXT NOT NULL,     // The default expression
 constraints TEXT NOT NULL, // The constraints of this column
 other   TEXT,              // Notes, etc
 FOREIGN KEY t_id REFERENCES sUSRTableInfo,
 UNIQUE ( t_id, 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.