uk.ac.ic.doc.automed.wrappers
Class SQLWrapperFactory

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory
        |
        +--uk.ac.ic.doc.automed.wrappers.SQLWrapperFactory
Direct Known Subclasses:
PostgresWrapperFactory

public abstract class SQLWrapperFactory
extends AutoMedWrapperFactory

An AutoMed high wrapper factory for creating SQLWrapper instances.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
static java.lang.String AUTOMED_SQL_MODEL_FIELD
           
static java.lang.String AUTOMED_SQL_MODEL_FOREIGN_KEY
           
static java.lang.String AUTOMED_SQL_MODEL_INDEX
           
static java.lang.String AUTOMED_SQL_MODEL_PRIMARY_KEY
           
static java.lang.String AUTOMED_SQL_MODEL_TABLE
           
static int DATA_SIZE
           
static int DATA_TYPE
           
static int FIELD_POSITION
           
static int FOREIGN_KEY
           
static int INDEX
           
static int NULL_CONSTRAINT
           
static int PRIMARY_KEY
           
static java.lang.String SQL_MODEL_FOREIGN_KEY
           
static java.lang.String SQL_MODEL_INDEX
           
static java.lang.String SQL_MODEL_PRIMARY_KEY
           
static java.lang.String SQL_MODEL_TABLE
          The name of the Construct used to represent SQL tables.
 
Constructor Summary
SQLWrapperFactory()
           
 
Method Summary
abstract  SQLWrapper build(java.lang.String username, java.lang.String password, java.lang.String driver, java.lang.String url, java.lang.String schemaName)
           
 void createAutoMedModel()
          Define a relational modelling language for the SQL standard which is an "AutoMed" oriented modelling language..
 Schema createAutoMedSchema(java.lang.String schemaName)
          Create an AutoMed standard relational schema from the source oriented schema.
 void createSQLModel()
          Define a relational modelling language for the SQL standard, together with the JDBC protocol for accessing SQL compliant databases.
 Model getAutoMedModel()
          Return the AutoMed relational Model used to represent the Schema for the SQL datasource wrapper.
 java.lang.String getAutoMedModelName()
          Find the name of the Model that will be used to represent an AutoMed oriented view of the data source.
 int getFeatures()
           
 Model getModel()
          Return the `raw' relational Model used to represent the Schema for the SQL datasource wrapper.
 java.lang.String getModelName()
          Find the name of the Model that will be used when a new wrapper is generated
 boolean isFeatureInUse(int features)
          Test if a certain group of features is being implemented in the representation of the SQL92 data model in the AutoMed repository
 void setBaseName(java.lang.String baseName)
          Set what name is used in the AutoMed repository for the Model in which SQL is to be represented.
 void setFeatures(int features)
          Allows certain features of the SQL92 data model to be represented in the AutoMed repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQL_MODEL_TABLE

public static final java.lang.String SQL_MODEL_TABLE
The name of the Construct used to represent SQL tables. This is a HDM node, where the node name is that of the SQL table, and the labels that follow it represent field names of the table.

See Also:
Constant Field Values

SQL_MODEL_PRIMARY_KEY

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

SQL_MODEL_FOREIGN_KEY

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

SQL_MODEL_INDEX

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

AUTOMED_SQL_MODEL_TABLE

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

AUTOMED_SQL_MODEL_FIELD

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

AUTOMED_SQL_MODEL_PRIMARY_KEY

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

AUTOMED_SQL_MODEL_FOREIGN_KEY

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

AUTOMED_SQL_MODEL_INDEX

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

INDEX

public static final int INDEX
See Also:
Constant Field Values

PRIMARY_KEY

public static final int PRIMARY_KEY
See Also:
Constant Field Values

FOREIGN_KEY

public static final int FOREIGN_KEY
See Also:
Constant Field Values

NULL_CONSTRAINT

public static final int NULL_CONSTRAINT
See Also:
Constant Field Values

DATA_TYPE

public static final int DATA_TYPE
See Also:
Constant Field Values

DATA_SIZE

public static final int DATA_SIZE
See Also:
Constant Field Values

FIELD_POSITION

public static final int FIELD_POSITION
See Also:
Constant Field Values
Constructor Detail

SQLWrapperFactory

public SQLWrapperFactory()
Method Detail

getModel

public final Model getModel()
Return the `raw' relational Model used to represent the Schema for the SQL datasource wrapper.


getAutoMedModel

public final Model getAutoMedModel()
Return the AutoMed relational Model used to represent the Schema for the SQL datasource wrapper.


setFeatures

public void setFeatures(int features)
Allows certain features of the SQL92 data model to be represented in the AutoMed repository.

Parameters:
features - a bit wise `or' of the feature flags INDEX, PRIMARY_KEY, FOREIGN_KEY, NULL_CONSTRAINT, DATA_TYPE, DATA_SIZE, FIELD_POSITION, indicating which features are to be used in addition. By default no features are used, maaning that the AutoMed comprises of tables with untyped fields

getAutoMedModelName

public java.lang.String getAutoMedModelName()
Find the name of the Model that will be used to represent an AutoMed oriented view of the data source.

Returns:
name of Model used for the Schema of new wrappers.

getModelName

public java.lang.String getModelName()
Find the name of the Model that will be used when a new wrapper is generated

Returns:
name of Model used for the Schema of new wrappers.

getFeatures

public int getFeatures()

isFeatureInUse

public boolean isFeatureInUse(int features)
Test if a certain group of features is being implemented in the representation of the SQL92 data model in the AutoMed repository

Parameters:
features - is the bitwise `or' of feature ignore flags to be tested
Returns:
true if all those features are being ignored

setBaseName

public void setBaseName(java.lang.String baseName)
Set what name is used in the AutoMed repository for the Model in which SQL is to be represented. Note that if any features are set, then the actual name created with be suffixed with an underscore and the numeric value returned by getFeatures(). Hence one may set different features for different wrappers of the relational model, and have them stored under different model names.

Parameters:
baseName - text that appears at the start of Model name

createAutoMedModel

public void createAutoMedModel()
Define a relational modelling language for the SQL standard which is an "AutoMed" oriented modelling language..


createSQLModel

public void createSQLModel()
Define a relational modelling language for the SQL standard, together with the JDBC protocol for accessing SQL compliant databases. Note that this is automatically called by getModel() if the SQL model for this factory does not already exist, and thus only needs to called by user appications if there is the need to create the SQL model indenpendently of wrapping a data source.


createAutoMedSchema

public Schema createAutoMedSchema(java.lang.String schemaName)
                           throws IntegrityException,
                                  NotFoundException
Create an AutoMed standard relational schema from the source oriented schema.

Parameters:
schemaName - name of the new AutoMed construct oriented schema that is to be created from the source oriented schema.
IntegrityException
NotFoundException

build

public abstract SQLWrapper build(java.lang.String username,
                                 java.lang.String password,
                                 java.lang.String driver,
                                 java.lang.String url,
                                 java.lang.String schemaName)
                          throws IntegrityException,
                                 DataSourceException
IntegrityException
DataSourceException