basic
Class AutoMedInANutshell

java.lang.Object
  extended by basic.AutoMedInANutshell

public class AutoMedInANutshell
extends java.lang.Object

An application to demonstrate how to create schemas in existing models


Field Summary
static int debug
           
 
Constructor Summary
AutoMedInANutshell()
           
 
Method Summary
static void banner(Schema s)
           
static void banner(java.lang.String title)
           
static Schema changePrimaryKey(Schema s, SchemaObject table, SchemaObject[] newKeyColumns)
          Change which columns are used to identify a table.
static Schema createAndTransformERSchema()
           
static Schema createMDRERSchema(boolean force)
           
static Schema deriveTable(Schema s, java.lang.String newTableName, java.lang.String newTablePrimaryKeyName, java.lang.String oldTableForeignKeyName, SchemaObject[] pkcols, SchemaObject[] fdcols, SchemaObject[] delcols)
          Derive a new table from the contents of an old table.
static Schema extendIntoNewTable(Schema s, java.lang.String newTableName, java.lang.String newTablePrimaryKeyName, SchemaObject oldTable, java.util.HashMap limitIQL, boolean isExact)
           
static void halevyExample()
           
static void integrateSchemas(Schema s1, Schema s2)
           
static void integrateSchemas(Schema s1, Schema s2, java.lang.String iqlFunction)
          This should be a fairly standard check in an AutoMed application to see if two schemas can be "integrated" via an ID transformation.
static void main(java.lang.String[] args)
           
static Schema normaliseTable(Schema s, java.lang.String newTableName, java.lang.String newTablePrimaryKeyName, java.lang.String oldTableForeignKeyName, SchemaObject[] pkcols, SchemaObject[] fdcols)
          Convert a table into Third Normal Form (3NF).
static void openEditorPanel(java.lang.String sn)
           
static Schema splitTable(Schema s, SchemaObject oldTable, java.lang.String newTableName1, SchemaObject[] newKeyColumns1, SchemaObject[] newFDColumns1, java.lang.String newTableName2, SchemaObject[] newKeyColumns2, SchemaObject[] newFDColumns2)
          Split a table into two tables.
static void testUniversity()
           
static void transformUniversity()
           
static Schema wrapAnsitest()
           
static Schema wrapBankBranch()
           
static Schema wrapBankBranchPostgres()
           
static Schema wrapBiomapPostgres()
           
static void wrapHalevy()
           
static Schema wrapMP3DB1Postgres()
           
static Schema wrapOracle()
           
static Schema wrapPublicSchema(java.lang.String sn)
           
static Schema wrapSchema(java.lang.String username, java.lang.String password, java.lang.String driver, java.lang.String urlbase, SQLWrapperFactory wf, java.lang.String db, java.lang.String name)
           
static Schema wrapTest()
           
static Schema wrapUniversity()
           
static void writePathways(java.lang.String sch, java.io.OutputStream os)
           
static void xmlWrapperExample()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static int debug
Constructor Detail

AutoMedInANutshell

public AutoMedInANutshell()
Method Detail

integrateSchemas

public static void integrateSchemas(Schema s1,
                                    Schema s2,
                                    java.lang.String iqlFunction)
                             throws AutoMedException
This should be a fairly standard check in an AutoMed application to see if two schemas can be "integrated" via an ID transformation.

Throws:
AutoMedException

integrateSchemas

public static void integrateSchemas(Schema s1,
                                    Schema s2)
                             throws AutoMedException
Throws:
AutoMedException

banner

public static void banner(java.lang.String title)

banner

public static void banner(Schema s)

wrapSchema

public static Schema wrapSchema(java.lang.String username,
                                java.lang.String password,
                                java.lang.String driver,
                                java.lang.String urlbase,
                                SQLWrapperFactory wf,
                                java.lang.String db,
                                java.lang.String name)
                         throws java.lang.Exception
Throws:
java.lang.Exception

createAndTransformERSchema

public static Schema createAndTransformERSchema()
                                         throws NotFoundException,
                                                TypeMismatchException,
                                                IntegrityException
Throws:
NotFoundException
TypeMismatchException
IntegrityException

createMDRERSchema

public static Schema createMDRERSchema(boolean force)
                                throws NotFoundException,
                                       TypeMismatchException,
                                       IntegrityException
Throws:
NotFoundException
TypeMismatchException
IntegrityException

openEditorPanel

public static void openEditorPanel(java.lang.String sn)

wrapPublicSchema

public static Schema wrapPublicSchema(java.lang.String sn)
                               throws IntegrityException,
                                      DataSourceException,
                                      java.io.IOException
Throws:
IntegrityException
DataSourceException
java.io.IOException

wrapUniversity

public static Schema wrapUniversity()
                             throws IntegrityException,
                                    DataSourceException
Throws:
IntegrityException
DataSourceException

testUniversity

public static void testUniversity()
                           throws IntegrityException,
                                  DataSourceException,
                                  java.lang.Exception
Throws:
IntegrityException
DataSourceException
java.lang.Exception

wrapTest

public static Schema wrapTest()
                       throws IntegrityException,
                              DataSourceException,
                              NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapBankBranch

public static Schema wrapBankBranch()
                             throws IntegrityException,
                                    DataSourceException,
                                    NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapMP3DB1Postgres

public static Schema wrapMP3DB1Postgres()
                                 throws IntegrityException,
                                        DataSourceException,
                                        NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapBankBranchPostgres

public static Schema wrapBankBranchPostgres()
                                     throws IntegrityException,
                                            DataSourceException,
                                            NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapBiomapPostgres

public static Schema wrapBiomapPostgres()
                                 throws IntegrityException,
                                        DataSourceException,
                                        NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapHalevy

public static void wrapHalevy()
                       throws IntegrityException,
                              DataSourceException,
                              NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapOracle

public static Schema wrapOracle()
                         throws IntegrityException,
                                DataSourceException,
                                NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

wrapAnsitest

public static Schema wrapAnsitest()
                           throws IntegrityException,
                                  DataSourceException,
                                  NotFoundException
Throws:
IntegrityException
DataSourceException
NotFoundException

transformUniversity

public static void transformUniversity()

extendIntoNewTable

public static Schema extendIntoNewTable(Schema s,
                                        java.lang.String newTableName,
                                        java.lang.String newTablePrimaryKeyName,
                                        SchemaObject oldTable,
                                        java.util.HashMap limitIQL,
                                        boolean isExact)
                                 throws NotFoundException,
                                        TypeMismatchException,
                                        IntegrityException
Throws:
NotFoundException
TypeMismatchException
IntegrityException

changePrimaryKey

public static Schema changePrimaryKey(Schema s,
                                      SchemaObject table,
                                      SchemaObject[] newKeyColumns)
                               throws NotFoundException,
                                      TypeMismatchException,
                                      IntegrityException
Change which columns are used to identify a table.

Throws:
NotFoundException
TypeMismatchException
IntegrityException

splitTable

public static Schema splitTable(Schema s,
                                SchemaObject oldTable,
                                java.lang.String newTableName1,
                                SchemaObject[] newKeyColumns1,
                                SchemaObject[] newFDColumns1,
                                java.lang.String newTableName2,
                                SchemaObject[] newKeyColumns2,
                                SchemaObject[] newFDColumns2)
                         throws NotFoundException,
                                TypeMismatchException,
                                IntegrityException
Split a table into two tables.

Throws:
NotFoundException
TypeMismatchException
IntegrityException

normaliseTable

public static Schema normaliseTable(Schema s,
                                    java.lang.String newTableName,
                                    java.lang.String newTablePrimaryKeyName,
                                    java.lang.String oldTableForeignKeyName,
                                    SchemaObject[] pkcols,
                                    SchemaObject[] fdcols)
                             throws NotFoundException,
                                    TypeMismatchException,
                                    IntegrityException
Convert a table into Third Normal Form (3NF). If a table breaks 3NF by having some `fdcols' columns fuctionally depend on non-key 'pkcols' columns, we can normalise the schema by placing those functionally dependent columns in a new table, which shares with the old table the 'pkcols'

Throws:
NotFoundException
TypeMismatchException
IntegrityException

deriveTable

public static Schema deriveTable(Schema s,
                                 java.lang.String newTableName,
                                 java.lang.String newTablePrimaryKeyName,
                                 java.lang.String oldTableForeignKeyName,
                                 SchemaObject[] pkcols,
                                 SchemaObject[] fdcols,
                                 SchemaObject[] delcols)
                          throws NotFoundException,
                                 TypeMismatchException,
                                 IntegrityException
Derive a new table from the contents of an old table. The new table will have some `fdcols' columns fuctionally depend 'pkcols' columns.

Throws:
NotFoundException
TypeMismatchException
IntegrityException

writePathways

public static void writePathways(java.lang.String sch,
                                 java.io.OutputStream os)
                          throws NotFoundException,
                                 IntegrityException,
                                 IllegalOperationException
Throws:
NotFoundException
IntegrityException
IllegalOperationException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

xmlWrapperExample

public static void xmlWrapperExample()
                              throws java.lang.Exception
Throws:
java.lang.Exception

halevyExample

public static void halevyExample()
                          throws java.lang.Exception
Throws:
java.lang.Exception