|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.reps.Utility
public class Utility
Class offering utility methods for accessing a SchemaObject's scheme. Models are "er" with constructs entity, attribute, relationship, generalisation and "sql92" with constructs table,field,primary_key,foreign_key,index.
SchemaObject
,
AppConstants
Field Summary | |
---|---|
private static java.lang.String |
attributeConstructName
|
private static java.lang.String |
entityConstructName
|
private static java.lang.String |
erModelName
|
private static java.lang.String |
fieldConstructName
|
private static java.lang.String |
foreignKeyConstructName
|
private static java.lang.String |
generalizationConstructName
|
private static java.lang.String |
indexConstructName
|
private static java.lang.String |
primaryKeyConstructName
|
private static java.lang.String |
relationalModelName
|
private static java.lang.String |
relationshipConstructName
|
private static java.lang.String |
tableConstructName
|
Constructor Summary | |
---|---|
Utility()
|
Method Summary | |
---|---|
static DBAccess |
connectToReps(java.lang.String repsName)
Connect to a local AutoMed reps by name |
static SchemaObject[] |
getConstraintReferencedConstructs(SchemaObject schemaObject)
Returns all the objects in a SchemaObject's scheme that are correspond to positions in the SchemaObject's scheme of type SCHEME_TYPE_CONSTRUCT |
static SchemaObject |
getGeneralConstruct(SchemaObject schemaObject)
Returns a SchemaObject corresponding to the "general" entity of a generalization. |
static java.util.Vector |
getHDMSchemasFromReps(java.lang.String repsName)
Get a list of schemas from a repository. |
static SchemaObject |
getPrimaryKeyOfTable(Schema schema,
SchemaObject schemaObject)
Returns the primary key of a table SchemaObject. |
static SchemaObject |
getReferencedConstruct(SchemaObject schemaObject)
Returns the object a SchemaObject is attached to. |
static SchemaObject[] |
getReferencedConstructs(SchemaObject schemaObject)
Returns all the objects in a SchemaObject's scheme that are correspond to positions in the SchemaObject's scheme of type SCHEME_TYPE_CONSTRUCT
that are of NODAL class. |
static SchemaObject |
getReferencedField(SchemaObject schemaObject)
Returns the field of a primary key SchemaObject. |
static SchemaObject[] |
getReferencedObjects(SchemaObject schemaObject)
Returns all the objects in a SchemaObject's scheme that are correspond to positions in the SchemaObject's scheme of type SCHEME_TYPE_CONSTRUCT . |
static SchemaObject |
getReferencedTable(SchemaObject schemaObject)
Returns the table of a primary key SchemaObject. |
static SchemaObject[] |
getReferringObjects(Schema schema,
SchemaObject object)
Returns the SchemaObject objects that include object in their schemes. |
static SchemaObject[] |
getSpecialConstructs(SchemaObject schemaObject)
Returns an array of SchemaObject objects corresponing to the sub-entities of a generalization. |
static SchemaObject |
getTableForeignKeyPoints(SchemaObject schemaObject)
Returns the table that a foreign key SchemaObject points. |
static SchemaObject |
getTableWithForeignKey(SchemaObject schemaObject)
Returns the table of a foreign key SchemaObject. |
static void |
initialiseRepository(java.lang.String sourceName)
Used by initRepository() to initialise a particulare data source |
static void |
initRepository()
This method reinitialises the peer's repository assuming that the default configuration has been pre-loaded by DSRConfiguration in a previous step. |
static boolean |
isPrimaryKeyForeignKey(Schema schema,
SchemaObject schemaObject)
Returns whether a foreign-key field SchemaObject is also a primary-key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.String erModelName
private static java.lang.String entityConstructName
private static java.lang.String attributeConstructName
private static java.lang.String relationshipConstructName
private static java.lang.String generalizationConstructName
private static java.lang.String relationalModelName
private static java.lang.String tableConstructName
private static java.lang.String fieldConstructName
private static java.lang.String primaryKeyConstructName
private static java.lang.String foreignKeyConstructName
private static java.lang.String indexConstructName
Constructor Detail |
---|
public Utility()
Method Detail |
---|
public static SchemaObject[] getSpecialConstructs(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
- the generalization object
AutoRepException
- if schemaObject
isn't an ER generailzation, or if the object
has no scheme.
NotFoundException
public static SchemaObject getGeneralConstruct(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
- the generalization object
AutoRepException
- if schemaObject
isn't an ER generailzation, or if the object
has no scheme.
NotFoundException
public static SchemaObject[] getReferencedConstructs(SchemaObject schemaObject)
SCHEME_TYPE_CONSTRUCT
that are of NODAL class.
schemaObject
- the SchemaObject whose scheme is checked
SCHEME_TYPE_CONSTRUCT
positions
NotFoundException
- if the schemaObject
isn't a link-type object
or if it hasn't got a scheme.AppConstants
public static SchemaObject[] getReferencedObjects(SchemaObject schemaObject) throws NotFoundException
SCHEME_TYPE_CONSTRUCT
.
schemaObject
- the SchemaObject whose scheme is checked
SCHEME_TYPE_CONSTRUCT
positions
NotFoundException
- if the object hasn't got a scheme.AppConstants
public static SchemaObject getReferencedConstruct(SchemaObject schemaObject) throws AutoRepException
schemaObject
- the linknodal object
AutoRepException
- if schemaObject
isn't a link-nodal object
or if it hasn't got a scheme.public static SchemaObject getReferencedTable(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
must be a primary-key
SchemaObject (model: "sql92", construct: "primary_key").
schemaObject
- the primary-key object
" @return the primary-key's table
AutoRepException
- if schemaObject
isn't a primary-key
or if it hasn't got a scheme.
AutoMedException
DSRException
NotFoundException
java.sql.SQLException
java.io.IOException
MDRException
public static SchemaObject getReferencedField(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
must be a primary-key
SchemaObject (model: "sql92", construct: "primary_key").
schemaObject
- the primary-key object
" @return the primary-key's table
AutoRepException
- if schemaObject
isn't a primary-key
or if it hasn't got a scheme.
InconsistentException
NotFoundException
public static SchemaObject getTableWithForeignKey(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
must be a foreign-key
SchemaObject (model: "sql92", construct: "foreign_key").
schemaObject
- the foreign-key object
" @return the foreign-key field's table
AutoRepException
- if schemaObject
isn't a foreign-key, or of it doesn't have a scheme
NotFoundException
public static SchemaObject getTableForeignKeyPoints(SchemaObject schemaObject) throws AutoRepException, NotFoundException
schemaObject
must be a foreign-key
SchemaObject (model: "sql92", construct: "foreign_key").
schemaObject
- the foreign-key object
AutoRepException
- if schemaObject
isn't a foreign-key, or of it doesn't have a scheme
InconsistentException
NotFoundException
public static boolean isPrimaryKeyForeignKey(Schema schema, SchemaObject schemaObject) throws AutoRepException, NotFoundException
schema
is the schema where the table, the table's primary-key and foreign-key have been defined. schemaObject
must be a foreign-key SchemaObject (model: "sql92", construct: "foreign_key").
schema
- the schema objectschemaObject
- the foreign-key object
true
if the foreign-key field is also a primary-key, false
otherwise
AutoRepException
- if schemaObject
isn't a foreign-key, or if it doesn't have a scheme or if the primary-key of the table the foreign-key points is illegal (isn't a primary-key)
InconsistentException
NotFoundException
public static SchemaObject getPrimaryKeyOfTable(Schema schema, SchemaObject schemaObject) throws NotFoundException, AutoRepException
schema
is the schema where both table and table's primary-key are defined. schemaObject
must be a table SchemaObject (model: "sql92", construct: "table").
schema
- the schema objectschemaObject
- the table object
AutoRepException
- if the schemaObject
isn't a table, or if the table doesn't have a primary-key
InconsistenException
NotFoundException
public static SchemaObject[] getConstraintReferencedConstructs(SchemaObject schemaObject) throws AutoRepException, NotFoundException
SCHEME_TYPE_CONSTRUCT
schemaObject
- the SchemaObject whose scheme is checked
SCHEME_TYPE_CONSTRUCT
positions
AutoRepException
- if the schemaObject
isn't a constraint-type object
or if it hasn't got a scheme.
NotFoundException
AppConstants
public static SchemaObject[] getReferringObjects(Schema schema, SchemaObject object) throws InconsistentException
object
in their schemes.
object
- the SchemaObject to look for in other SchemaObjects schemesschema
- the schema object
belongs to
object
InconsitentException
InconsistentException
public static void initRepository() throws AutoMedException
DSRConfiguration
in a previous step.
AutoMedException
public static void initialiseRepository(java.lang.String sourceName) throws AutoMedException
initRepository()
to initialise a particulare data source
AutoMedException
public static DBAccess connectToReps(java.lang.String repsName) throws AutoMedException
AutoMedException
public static java.util.Vector getHDMSchemasFromReps(java.lang.String repsName) throws AutoMedException
repsName
-
AutoMedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |