com.im.df.api 5.9

com.im.df.api.capabilities
Interface DBSchemaCapability

All Superinterfaces:
DFCapability
All Known Subinterfaces:
JChemSchemaCapability

public interface DBSchemaCapability
extends DFCapability

Schema's capability specially for relational DB connections. Note that there potentially confusing temininology for the term "schema" as it is used for two purposes:

Where possible we try to distinguish these by using the term ijcSchema for the former and dbSchemaName for the latter. Note: Support for multiple database schemas does not yet exist in DIF. Methods for multiple schemas are in place ready for this, but at this stage all operations default to the default schema. Multi-schema support will be implemented in a future version.


Field Summary
static String PROP_EXTRA_SCHEMAS
           
static String PROP_SUPPLEMENTAL_TABLES
          Name for the 'supplemental tables' property
static String PROP_TABLES
          Name for the 'allTableNames' property TODO property change event is not never fired for this property.
static String PROP_VIEWS
          TODO unused property
static String XATTR_SCHEMA_LOGGING
           
 
Method Summary
 boolean claimTableOwnership(SchemaQualifiedName tableName)
          Determines if the table is an implementation artifact of the Schema.
 Set<DBTableInfo> getAllManagedTableInfos()
          Get all managed tables from all schemas
 String[] getAllSchemas()
           
 DBTableInfo[] getAllTableInfos()
           
 String[] getAllTableNames()
          Deprecated. 
 String[] getAllTableNames(String dbSchemaName)
          Get the names of the actual physical tables know to this IJC schema.
 DBTableInfo[] getAllViewInfos()
           
 String[] getAllViewNames()
          Deprecated. Use the form that takes the dbSchema as an argument.
 String[] getAllViewNames(String dbSchemaName)
          Get the names of the views know to this schema.
 SchemaQualifiedName[] getConstraintNames()
          Retrieves names of constraints defined within the database.
 DBType getDatabaseType()
          Get the database type e.g.
 String getDefaultDBSchemaName()
          The default schema used by this database.
 String[] getExtraSchemas()
           
 Set<String> getManagedTables()
          Deprecated. Use the form that takes the dbSchema as an argument.
 Set<String> getManagedTables(String dbSchemaName)
          Returns the set of 'managed' tables, those the schema knows about.
 int getMaxColumnNameLength()
          Retrieves the maximum number of characters this database allows for a column name.
 int getMaxIndexNameLength()
          Retrieves the maximum number of characters this database allows for a index name.
 int getMaxTableNameLength()
          Retrieves the maximum number of characters this database allows in a table name.
 SchemaInfo.PerformanceMode getPerformanceMode()
           
 SchemaInfo.PerformanceMode getPreviousPerformanceMode()
           
 Set<String> getSystemTables()
          Returns the set of system tables created for internal purposes of IJC
 DBTableInfo getTableInfo(SchemaQualifiedName schemaPlusTable)
          Get information about the specified table.
 DBTableInfo getTableInfo(String schemaPlusTable)
          Deprecated.  
 DBTableInfo getTableInfo(String dbSchemaName, String tableName)
          Get information about the specified table, possibly retrieving it from a cache.
 Set<DBDatabaseInfo.DatabaseOperation> getUnsupportedDatabaseOperations()
          Get the set of unsupported operations in this database
 boolean isSupportingDBSchemas()
          Whether DB used by this schema supports DB schemas
 void removeTable(String dbSchemaName, String tableName, DFEnvironmentRW env)
           
 void setExtraSchemas(List<String> dbSchemas, DFEnvironmentRW env)
           
 void setPerformanceMode(SchemaInfo.PerformanceMode performanceMode, DFEnvironmentRW env)
           
 

Field Detail

PROP_TABLES

static final String PROP_TABLES
Name for the 'allTableNames' property TODO property change event is not never fired for this property.

See Also:
Constant Field Values

PROP_SUPPLEMENTAL_TABLES

static final String PROP_SUPPLEMENTAL_TABLES
Name for the 'supplemental tables' property

See Also:
Constant Field Values

PROP_VIEWS

static final String PROP_VIEWS
TODO unused property

See Also:
Constant Field Values

PROP_EXTRA_SCHEMAS

static final String PROP_EXTRA_SCHEMAS
See Also:
Constant Field Values

XATTR_SCHEMA_LOGGING

static final String XATTR_SCHEMA_LOGGING
See Also:
Constant Field Values
Method Detail

getUnsupportedDatabaseOperations

Set<DBDatabaseInfo.DatabaseOperation> getUnsupportedDatabaseOperations()
Get the set of unsupported operations in this database


getMaxTableNameLength

int getMaxTableNameLength()
Retrieves the maximum number of characters this database allows in a table name.


getMaxColumnNameLength

int getMaxColumnNameLength()
Retrieves the maximum number of characters this database allows for a column name.


getMaxIndexNameLength

int getMaxIndexNameLength()
Retrieves the maximum number of characters this database allows for a index name.


getAllTableNames

@Deprecated
String[] getAllTableNames()
Deprecated. 

Get the names of the actual physical tables know to this IJC schema. This will not include views, synonyms etc.

NOTE: This is a snapshot of the table names and is not updated if tables are added or dropped. Do not hold a long term reference to this.


getAllTableNames

String[] getAllTableNames(String dbSchemaName)
Get the names of the actual physical tables know to this IJC schema. This will not include views, synonyms etc.

NOTE: This is a snapshot of the table names and is not updated if tables are added or dropped. Do not hold a long term reference to this.

Parameters:
dbSchemaName - The name of the database schema (not to be confused with the name of this IJC schema). Will be null for databases that do not support schemas.
Returns:
An array of table names

getManagedTables

Set<String> getManagedTables()
Deprecated. Use the form that takes the dbSchema as an argument.

Returns the set of 'managed' tables in the default db schema, those the schema knows about. This include entity tables as well as any other "supplemental" tables, like the schema meta data tables or jchem property tables associated with the entities.

This depends on actual implementation.

Returns:
The tables names

getManagedTables

Set<String> getManagedTables(String dbSchemaName)
Returns the set of 'managed' tables, those the schema knows about. This include entity tables as well as any other "supplemental" tables, like the schema meta data tables or jchem property tables associated with the entities.

This depends on actual implementation.

Parameters:
dbSchemaName - The name of the database schema (not to be confused with the name of this IJC schema). Will be null for databases that do not support schemas.
Returns:
The tables names

getAllManagedTableInfos

Set<DBTableInfo> getAllManagedTableInfos()
Get all managed tables from all schemas

Returns:
The managed tables

getSystemTables

Set<String> getSystemTables()
Returns the set of system tables created for internal purposes of IJC

Returns:
The set of system tables

getTableInfo

@Deprecated
DBTableInfo getTableInfo(String schemaPlusTable)
Deprecated. 

Get information about the specified table. The term "table" is used in the generic sense and can include views etc. See @{link com.im.commons.db.ddl.DBTableInfo} for more details.

NOTE: This is a snapshot of the table and will not be updated if the table changes in any way. Do not hold a long term reference to this.

Parameters:
schemaPlusTable - The schema qualified name of the table, view etc.
Returns:
A DBTableInfo object describing the table.

getTableInfo

DBTableInfo getTableInfo(SchemaQualifiedName schemaPlusTable)
Get information about the specified table. The term "table" is used in the generic sense and can include views etc. See @{link com.im.commons.db.ddl.DBTableInfo} for more details.

NOTE: This is a snapshot of the table and will not be updated if the table changes in any way. Do not hold a long term reference to this.

Parameters:
schemaPlusTable - The schema qualified name of the table, view etc.
Returns:
A DBTableInfo object describing the table.

getTableInfo

DBTableInfo getTableInfo(String dbSchemaName,
                         String tableName)
Get information about the specified table, possibly retrieving it from a cache. The term "table" is used in the generic sense and can include views etc. See @{link com.im.commons.db.ddl.DBTableInfo} for more details.

NOTE: This is a snapshot of the table and will not be updated if the table changes in any way. Do not hold a long term reference to this.

Parameters:
tableName - The name of the table, view etc.
dbSchemaName - The name of the database schema (not to be confused with the name of this IJC schema). Will be null for databases that do not support schemas.
Returns:
A DBTableInfo object describing the table.

getAllViewNames

String[] getAllViewNames()
Deprecated. Use the form that takes the dbSchema as an argument.

Get the names of the views know to this schema. This will not include table, synonyms etc.

NOTE: This is a snapshot of the view names and is not updated if views are added or dropped. Do not hold a long term reference to this.

Returns:
An array of all available sql views in schema.

getAllViewNames

String[] getAllViewNames(String dbSchemaName)
Get the names of the views know to this schema. This will not include table, synonyms etc.

NOTE: This is a snapshot of the view names and is not updated if views are added or dropped. Do not hold a long term reference to this.

Parameters:
dbSchemaName - The name of the database schema (not to be confused with the name of this IJC schema). Will be null for databases that do not support schemas.
Returns:
An array of all available sql views in schema.

claimTableOwnership

boolean claimTableOwnership(SchemaQualifiedName tableName)
Determines if the table is an implementation artifact of the Schema.

Parameters:
tableName -
Returns:
True if this table is an IJC system table for this schema

getDatabaseType

DBType getDatabaseType()
Get the database type e.g. oracle, derby, mysql, as returned by the getDBType() method of DBDatabaseInfo

Returns:
The database type.

getConstraintNames

SchemaQualifiedName[] getConstraintNames()
Retrieves names of constraints defined within the database. The names should include names of all FKs, but also names of unique and other constraints.

Returns:
The names of all constraints.

getDefaultDBSchemaName

String getDefaultDBSchemaName()
The default schema used by this database. Not to be confused with the IJC schema, this is the schema within the database (e.g. APP for Derby) so that tables can be referred to using their schema qualified name e.g. APP.SOME_TABLE

Returns:
The name of the default schema, or null if the database does not support schemas

getExtraSchemas

String[] getExtraSchemas()
Returns:
The extra defined schema names

getAllSchemas

String[] getAllSchemas()
Returns:
The all schema names

getAllTableInfos

DBTableInfo[] getAllTableInfos()
Returns:
The all tables from all schemas

getAllViewInfos

DBTableInfo[] getAllViewInfos()
Returns:
The all views from all schemas

setExtraSchemas

void setExtraSchemas(List<String> dbSchemas,
                     DFEnvironmentRW env)

isSupportingDBSchemas

boolean isSupportingDBSchemas()
Whether DB used by this schema supports DB schemas

Returns:
True if DB support DB schemas, false otherwise

getPerformanceMode

SchemaInfo.PerformanceMode getPerformanceMode()

getPreviousPerformanceMode

SchemaInfo.PerformanceMode getPreviousPerformanceMode()

setPerformanceMode

void setPerformanceMode(SchemaInfo.PerformanceMode performanceMode,
                        DFEnvironmentRW env)

removeTable

void removeTable(String dbSchemaName,
                 String tableName,
                 DFEnvironmentRW env)

com.im.df.api 5.9