edu.wpi.cs.DSRG.xmldb.storeDTD
Class CreateDTDM

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.storeDTD.CreateDTDM

public class CreateDTDM
extends java.lang.Object

CreateDTDM.java creates the MetadataTables (MTables) schema including the following relations: ALL_DTDS_DTDM_Item (stores all elements defined in loaded DTD documents), ALL_DTDS_DTDM_Nesting (stores all one to one and one to many relationships between one element and its children (nested) elements), ALL_DTDS_DTDM_Attribute (stores all attributes defined associated with their parent elements), and a relation called ALL_DTDS_DTD_ID_Mapping (stores all DTD URIs loaded and their internal DTD ids).

Since:
1/18/2000

Field Summary
(package private)  JDBCClient client_connection
           
 
Constructor Summary
CreateDTDM(JDBCClient client)
          This constructor is used when a JDBCClient object has already been defined.
CreateDTDM(java.lang.String DB_URI, java.lang.String username, java.lang.String password)
          This constructor is used when a connection has to be made to a database using the JDBCClient class.
 
Method Summary
 void create()
          The method create() creates the schema for the MTables.
private  void createCatalog()
          The method createCatalog() creates the relation that holds the relationship between a DTD URI and its internal ID.
 void drop()
          The method drop() will drop the relations for the MTables and the Catalog.
 void reset()
          The method reset() will reset the relations for the MTables and the Catalog.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

client_connection

JDBCClient client_connection
Constructor Detail

CreateDTDM

public CreateDTDM(JDBCClient client)
This constructor is used when a JDBCClient object has already been defined.
Parameters:
client - JDBCClient client connection

CreateDTDM

public CreateDTDM(java.lang.String DB_URI,
                  java.lang.String username,
                  java.lang.String password)
This constructor is used when a connection has to be made to a database using the JDBCClient class.
Parameters:
DB_URI - String The URI of the database.
username - String The username of the database account.
password - String The password of the database account.
Method Detail

create

public void create()
The method create() creates the schema for the MTables. It first calls the method createCatalog() to create a catalog to associate DTD URIs and DTD internal ids, and then makes and executes the queries that generate the three schemas pertaining to each relation for each MTable.

createCatalog

private void createCatalog()
The method createCatalog() creates the relation that holds the relationship between a DTD URI and its internal ID. This relation created is called ALL_DTDS_DTD_ID_Mapping.

drop

public void drop()
The method drop() will drop the relations for the MTables and the Catalog.

reset

public void reset()
The method reset() will reset the relations for the MTables and the Catalog.