uk.ac.bbk.dcs.automed.xml.relational
Class XMLDSSFromRDB

java.lang.Object
  extended by uk.ac.bbk.dcs.automed.xml.relational.XMLDSSFromRDB

public class XMLDSSFromRDB
extends java.lang.Object

  1. Create graph

    A DirectedGraph object contains a set of pointers to DirectedGraphNode objects and a set of pointers to other Graph objects A DirectedGraphNode object contains a name, a set of incoming edges and a set of outgoing edges, both pointing to other objects of the same type.


    Create a DirectedGraph object G. Create a two-dimensional structure S which will hold information on which attributes each relation has.


    For every construct C in the database schema

  2. Transform graph to forest

    Divide a given graph into subgraphs:


    For every DirectedGraphNode N in the set of nodes of Graph G that was not visited before:


    Then convert each one to a tree and add it to the Forest object:

  3. Transform forest to tree by inserting generic root node.

  4. Traverse generic tree and insert XMLDSS constructs, creating mixed schema.

    For every TreeNode T in the tree:

  5. Traverse mixed schema and delete relational constructs.

Author:
Lucas Zamboulis

Field Summary
static java.lang.String oracle
           
static java.lang.String postgres
           
 
Constructor Summary
XMLDSSFromRDB(java.lang.String dbType, java.lang.String username, java.lang.String password, java.lang.String driver, java.lang.String url, java.lang.String sName)
           
 
Method Summary
 void getAMXMLDSS()
          This method first creates a network of tables, based on their foreign key dependencies.
 Schema getRDBDSSchema()
           
 Schema getXMLDSSSchema()
           
 void setXMLDSSSchema(Schema s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oracle

public static final java.lang.String oracle
See Also:
Constant Field Values

postgres

public static final java.lang.String postgres
See Also:
Constant Field Values
Constructor Detail

XMLDSSFromRDB

public XMLDSSFromRDB(java.lang.String dbType,
                     java.lang.String username,
                     java.lang.String password,
                     java.lang.String driver,
                     java.lang.String url,
                     java.lang.String sName)
Parameters:
dbType - the database type, e.g. Oracle
username - the database username
password - the database password
driver - the database driver
url - the URL where the database resides
sName - the schema name
Method Detail

getAMXMLDSS

public void getAMXMLDSS()
                 throws java.lang.Exception
This method first creates a network of tables, based on their foreign key dependencies. Then it converts this network into a forest. Then it traverses the forest and inserts XMLDSS constructs in the original relational AutoMed schema. Then it removes all relational constructs from the original relational AutoMed schema.

It therefore effectively converts a relational AutoMed schema into an XMLDSS AutoMed schema.

Throws:
java.lang.Exception

getXMLDSSSchema

public Schema getXMLDSSSchema()

getRDBDSSchema

public Schema getRDBDSSchema()

setXMLDSSSchema

public void setXMLDSSSchema(Schema s)