|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory
uk.ac.ic.doc.automed.wrappers.SQLWrapperFactory
public class SQLWrapperFactory
An AutoMed high wrapper factory for creating SQLWrapper
instances.
Note that this implements a generic interface to JDBC drivers. To make
use of special features of a database, subclasses of the class must be
used.
Field Summary | |
---|---|
protected Model |
automed
|
static java.lang.String |
AUTOMED_SQL_MODEL_COLUMN
|
static java.lang.String |
AUTOMED_SQL_MODEL_FOREIGN_KEY
|
static java.lang.String |
AUTOMED_SQL_MODEL_INDEX
|
static java.lang.String |
AUTOMED_SQL_MODEL_NOTNULL_CONSTRAINT
|
static java.lang.String |
AUTOMED_SQL_MODEL_PRIMARY_KEY
|
static java.lang.String |
AUTOMED_SQL_MODEL_TABLE
|
static int |
COLUMN_POSITION
A feature option to model the position of a column in a table as part of a column in any Schema the
factory generates |
static int |
DATA_SIZE
A feature option to model the size in bytes of a column as part of a column in any Schema the
factory generates |
static int |
DATA_TYPE
A feature option to model the datatype of a column as part of a column in any Schema the
factory generates |
static int |
FOREIGN_KEY
A feature option to model foreign keys in any Schema the
factory generates |
static int |
INDEX
A feature option to model SQL Indexes in any Schema the
factory generates |
protected static boolean |
justTableName
|
static int |
NONSCALAR_COMPOUND_KEY
|
static int |
NULL_CONSTRAINT
A feature option to model the null/notnull distinction as part of a column in any Schema the
factory generates |
protected Construct |
primary_key
|
static int |
PRIMARY_KEY
A feature option to model primary keys in any Schema the
factory generates |
static java.lang.String |
ROOT_TYPE_NAME
|
static int |
SCHEMA_AWARE
A feature option to model SQL schemas. |
static int |
SCHEMA_MERGING
|
protected java.awt.Color |
source_background_colour
|
protected Model |
sql
|
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. |
protected Construct |
table
|
protected int |
tableSchemeLength
|
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory |
---|
automedModelName, baseName, empty, factoryInUse, modelName, SOURCE_PREFIX |
Constructor Summary | |
---|---|
SQLWrapperFactory()
|
Method Summary | |
---|---|
void |
createAutoMedModel()
Define a relational modelling language for the SQL standard which is an "AutoMed" oriented modelling language.. |
Schema |
createAutoMedSchema(AutoMedWrapper wrapper,
java.lang.String schemaName)
Create an AutoMed oriented schema from the source oriented schema. |
void |
createModel()
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. |
int |
getColumnDetailsSchemeLength()
Return the number of fields in a full source table scheme that are used to represent the structure and type of one column (ie its name, data type, size, null, ...) |
java.lang.String |
getDefaultSchemaName(AutoMedWrapper wrapper)
Return the name of the default schema for the type of database being wrapped. |
java.lang.String[] |
getFeatureNames()
Return a string list of features supported by this wrapper, where the first one is bit zero in the feature bit map, second bit one, etc |
Model |
getModel()
Return the `raw' relational Model used to represent the
Schema for the SQL datasource wrapper. |
protected java.lang.String |
getSQLTableReference(java.lang.Object[] scheme)
Given the scheme of a table, get the name SQL uses to reference that table. |
int |
getTableDetailsSchemeLength()
Return the number of fields in a full source table scheme used to reprsent the table details |
protected AutoMedWrapper |
newAutoMedWrapper()
Create a new empty wrapper instance that this wrapper factory is then able to populate. |
protected void |
populateSchema(AutoMedWrapper wrapper)
Read the metadata from the wrapper connection, and store in existing Schema within the wrapper. |
void |
setFeatures(int features)
Allows certain features of the SQL92 data model to be represented in the AutoMed repository. |
Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory |
---|
clearFeatures, getAttributeDomains, getAutoMedModelName, getFeatures, getModelBaseName, getModelName, isFeatureInUse, safeIQL, setAttributeDomains, setFeatures, setModelBaseName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Model sql
protected Construct table
protected Construct primary_key
protected java.awt.Color source_background_colour
public static final java.lang.String SQL_MODEL_TABLE
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 column names of the table.
public static final java.lang.String SQL_MODEL_PRIMARY_KEY
public static final java.lang.String SQL_MODEL_FOREIGN_KEY
public static final java.lang.String SQL_MODEL_INDEX
protected static final boolean justTableName
public static final java.lang.String ROOT_TYPE_NAME
protected Model automed
public static final java.lang.String AUTOMED_SQL_MODEL_TABLE
public static final java.lang.String AUTOMED_SQL_MODEL_COLUMN
public static final java.lang.String AUTOMED_SQL_MODEL_NOTNULL_CONSTRAINT
public static final java.lang.String AUTOMED_SQL_MODEL_PRIMARY_KEY
public static final java.lang.String AUTOMED_SQL_MODEL_FOREIGN_KEY
public static final java.lang.String AUTOMED_SQL_MODEL_INDEX
protected int tableSchemeLength
public static final int INDEX
Schema
the
factory generates
public static final int PRIMARY_KEY
Schema
the
factory generates
public static final int FOREIGN_KEY
Schema
the
factory generates
public static final int NULL_CONSTRAINT
Schema
the
factory generates
public static final int DATA_TYPE
Schema
the
factory generates
public static final int DATA_SIZE
Schema
the
factory generates
public static final int COLUMN_POSITION
Schema
the
factory generates
public static final int SCHEMA_AWARE
public static final int SCHEMA_MERGING
public static final int NONSCALAR_COMPOUND_KEY
Constructor Detail |
---|
public SQLWrapperFactory()
Method Detail |
---|
public int getColumnDetailsSchemeLength()
public int getTableDetailsSchemeLength()
public java.lang.String[] getFeatureNames()
getFeatureNames
in class AutoMedWrapperFactory
public final Model getModel()
Model
used to represent the
Schema
for the SQL datasource wrapper.
getModel
in class AutoMedWrapperFactory
public final Model getAutoMedModel()
Model
used to represent the
Schema
for the SQL datasource wrapper.
getAutoMedModel
in class AutoMedWrapperFactory
public void setFeatures(int features) throws IntegrityException
setFeatures
in class AutoMedWrapperFactory
features
- a bit wise `or' of the feature flags INDEX,
PRIMARY_KEY, FOREIGN_KEY, NULL_CONSTRAINT, DATA_TYPE, DATA_SIZE,
COLUMN_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 columns
IntegrityException
- if the factory is already being used for
producing wrappers. You should create a new SQLWrapperFactory for your
settings.public final void createAutoMedModel()
public final void createModel()
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 independently of wrapping a data source.
public java.lang.String getDefaultSchemaName(AutoMedWrapper wrapper)
protected void populateSchema(AutoMedWrapper wrapper) throws DataSourceException
AutoMedWrapperFactory
AutoMedWrapper
instances as part of the wrapper creation process.
populateSchema
in class AutoMedWrapperFactory
DataSourceException
protected java.lang.String getSQLTableReference(java.lang.Object[] scheme)
scheme
- holds the scheme of a table, as returned by
SchemaObject.getSchemeDefinition()
.
public Schema createAutoMedSchema(AutoMedWrapper wrapper, java.lang.String schemaName) throws IntegrityException, NotFoundException
AutoMedWrapperFactory
createAutoMedSchema
in class AutoMedWrapperFactory
wrapper
- A wrapper containing the source oriented Schema
from which the AutoMed oriented Schema should be
produced.schemaName
- name of the new AutoMed construct oriented schema
that is to be created from the source oriented schema. This schema must
not yet exist.
IntegrityException
- if schemaName already exists.
NotFoundException
- if you have not previously wrapped the
datasource as a source oriented schema, using either #AutoMedWrapper.getSchema(String)
or #AutoMedWrapper.selectNewAutoMedWrapper
protected AutoMedWrapper newAutoMedWrapper()
AutoMedWrapperFactory
newAutoMedWrapper
in class AutoMedWrapperFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |