Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.db.dictionary
Class DictionaryDatabase

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObjectProvider
      extended by oracle.javatools.db.AbstractDatabase
          extended by oracle.javatools.db.ddl.DDLDatabase
              extended by oracle.javatools.db.dictionary.DictionaryDatabase
All Implemented Interfaces:
Database, DBObjectProvider

public abstract class DictionaryDatabase
extends DDLDatabase

Database implementation that uses a DictionaryQueries object to provide the queries on the database's dictionary.

Since:
11.0
See Also:
DictionaryQueries

Field Summary
 
Fields inherited from class oracle.javatools.db.AbstractDatabase
SQLSTATE_NOT_IMPLEMENTED
 
Fields inherited from class oracle.javatools.db.AbstractDBObjectProvider
CASE_SENSITIVE_NAME_POLICY, EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, NEW_FROM_TEMPLATE_TYPE, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY
 
Fields inherited from interface oracle.javatools.db.Database
FOUR_GIG, GENERIC_JDBC_DATABASE, SOURCE_TYPE_BODY, SOURCE_TYPE_SPEC, TWO_GIG
 
Fields inherited from interface oracle.javatools.db.DBObjectProvider
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE, NEW_FROM_TEMPLATE_TYPE
 
Constructor Summary
protected DictionaryDatabase(java.lang.String connStore, java.lang.String connName, java.sql.Connection conn)
           
 
Method Summary
 void close()
          Closes the Database Connection (and the supplied JDBC Connection).
protected  SystemObject createByIDImpl(DBObjectID id)
           
 DBObjectID createID(Schema schema, java.lang.String name, java.lang.String type, java.lang.Object id)
           
 boolean exists(java.lang.String type, java.lang.String schema, java.lang.String name)
          Checks whether an object exists in the database.
protected  java.lang.String getAliveTestStatement()
          Returns a statement that, if executed succesfully, tests whether the given connections is live.
protected abstract  DictionaryQueries getDictionaryQueries()
           
protected  java.lang.Long getExternalTimestampByID(DBObjectID id)
           
protected  java.lang.Long getExternalTimestampByName(java.lang.String type, Schema schema, java.lang.String objectName)
           
protected  java.lang.Long getExternalTimestampImpl(SystemObject obj)
          Retrieves the timestamp for this object from the database.
protected  QueryWrapper[] getListQueries(DBObjectCriteria<? extends SystemObject> criteria)
          Retruns a number of query wrapper objects that will list the given object types in the given schema.
protected  java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, Schema schema, java.lang.String nameref, java.lang.String[] typeList)
           
protected  java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.lang.String[] typeList)
           
 java.lang.String getUserName()
          Retrieves the username used to connect to the database
 boolean isObjectValid(java.lang.String objectType, java.lang.String schema, java.lang.String objectName)
          Determines whether the specified database object is in a valid state.
protected  boolean isSupportedType(java.lang.String type)
           
protected
<T extends SystemObject>
java.util.Collection<T>
listObjectsImpl(DBObjectCriteria<T> criteria)
          Internal listObjects implementation.
protected  java.util.Map<java.lang.String,Schema> loadSchemasImpl()
           
protected  QueryWrapper newQueryWrapper(java.lang.String query, java.util.List params)
           
protected  QueryWrapper newQueryWrapper(java.lang.String query, java.lang.Object... params)
           
 boolean supportsTimestamps(java.lang.String objectType)
          Returns true if this database supports timestamping.
 
Methods inherited from class oracle.javatools.db.ddl.DDLDatabase
canCreate, canDelete, createObjects, createSchema, deleteObjects, deleteSchema, executeDDL, getDDLGenerator, getDiffEngine, isCauseNameInUse, listObjectsImpl, listSchemas, processCreateException, processDeleteException, registerExpanders, setCompilerOptions, undeleteObject, undeleteObjects, updateObjects, updateSchema
 
Methods inherited from class oracle.javatools.db.AbstractDatabase
cancelStatement, canRestrictSchemaList, createSchema, exists, finishCreate, finishDelete, finishDelete, getConnection, getConnection, getConnectionName, getConnectionStore, getCreatedObject, getDatabaseSource, getDatabaseSource, getDatabaseType, getDatabaseVersion, getDefaultSchema, getDescriptor, getName, getObjectImpl, getQualifiedName, getTransactionTestQuery, hasTransaction, isConnectionAlive, isConnectionAlive, isConnectionClosed, isUsernameCaseInsensitive, reconnect, reconnected, registerBuilders, registerValidators, setStatement, sqlTrace, sqlTrace, supportsDebugging, testSQLStatement
 
Methods inherited from class oracle.javatools.db.AbstractDBObjectProvider
addProviderListener, cacheObject, checkCachedObject, clearAllCaches, clearCache, convertObject, createObject, createObjectImpl, createObjectManager, deleteObject, destroyCache, findByID, findObject, findObject, findSchema, fireObjectsAdded, fireObjectsRemoved, fireProviderClosed, fireProviderDeleted, fireProviderOpened, fireProviderReloaded, fireSchemaAdded, fireSchemaObjectUpdated, fireSchemaRemoved, fireSchemaUpdated, getBuilderForType, getCachedTimestamp, getCascadeManager, getCasePolicy, getDataType, getDefaultTemplateForType, getExternalName, getExternalName, getExternalTimestamp, getIdentifierQuoteString, getInternalName, getInternalName, getLogger, getObject, getObject, getObjectFactory, getObjectManager, getOrCreateDataType, getPropertyManager, getQuotedNameCasePolicy, getSchema, getSchemaObjectExpanders, getTimestamp, getTimestamp, getUniqueName, getValidatorForType, hasPriviledge, isEditable, isNewFromTemplateType, isRequestedObject, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjects, listObjectsFromCache, listObjectsImpl, listObjectTypes, listSchemas, listSupportedDataTypes, logEvent, markForLazyInit, markForLazyInit, normaliseType, putCachedTimestampKey, quoteIdentifier, registerBuilder, registerSchemaObjectExpander, registerType, registerValidator, removeProviderListener, resetObject, resumeTimestampQueries, schemaUpdated, setDefaultTemplateForType, supportsObjectType, supportsTimestamps, suspendTimestampQueries, uncacheObject, unregisterBuilder, unregisterValidator, updateObject, updateObjects, validateName, validateName, validateObject, validateObject, validateObject, validateObject, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateSchema, validateSchema, validateUniqueName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.Database
getIdentifierQuoteString
 
Methods inherited from interface oracle.javatools.db.DBObjectProvider
addProviderListener, createObject, deleteObject, getCascadeManager, getDataType, getDefaultTemplateForType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getObject, getObjectFactory, getObjectManager, getOrCreateDataType, getPropertyManager, getSchema, getTimestamp, getTimestamp, getUniqueName, hasPriviledge, isEditable, isNewFromTemplateType, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjects, listObjectTypes, listSchemas, listSupportedDataTypes, quoteIdentifier, removeProviderListener, setDefaultTemplateForType, supportsObjectType, updateObject, updateObjects, validateName, validateName, validateObject, validateObject, validateObject, validateObject, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateSchema, validateSchema, validateUniqueName
 

Constructor Detail

DictionaryDatabase

protected DictionaryDatabase(java.lang.String connStore,
                             java.lang.String connName,
                             java.sql.Connection conn)
Method Detail

newQueryWrapper

protected final QueryWrapper newQueryWrapper(java.lang.String query,
                                             java.lang.Object... params)

newQueryWrapper

protected QueryWrapper newQueryWrapper(java.lang.String query,
                                       java.util.List params)

getDictionaryQueries

protected abstract DictionaryQueries getDictionaryQueries()

isSupportedType

protected boolean isSupportedType(java.lang.String type)

supportsTimestamps

public boolean supportsTimestamps(java.lang.String objectType)
Returns true if this database supports timestamping. By default this will return true if either the by ID or by name (for tables) timestamp queries are non-null. Override if appropraite.

Overrides:
supportsTimestamps in class AbstractDBObjectProvider

getListQueries

protected QueryWrapper[] getListQueries(DBObjectCriteria<? extends SystemObject> criteria)
Retruns a number of query wrapper objects that will list the given object types in the given schema.

Ideally this method would only return one query wrapper as that will most probably be more efficient in getting the data. However where a Database implementation is unable to UNION the list queries together it can return multiple wrappers.


createID

public final DBObjectID createID(Schema schema,
                                 java.lang.String name,
                                 java.lang.String type,
                                 java.lang.Object id)

listObjectsImpl

protected <T extends SystemObject> java.util.Collection<T> listObjectsImpl(DBObjectCriteria<T> criteria)
                                                                throws DBException
Description copied from class: AbstractDBObjectProvider
Internal listObjects implementation. All listObjects methods call through to this.

Specified by:
listObjectsImpl in class AbstractDBObjectProvider
Throws:
DBException

getParameters

protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params,
                                                               Schema schema,
                                                               java.lang.String nameref,
                                                               java.lang.String[] typeList)

getParameters

protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params,
                                                               java.lang.String schema,
                                                               java.lang.String nameref,
                                                               java.lang.String[] typeList)

getExternalTimestampImpl

protected final java.lang.Long getExternalTimestampImpl(SystemObject obj)
                                                 throws DBException
Retrieves the timestamp for this object from the database.

Overrides:
getExternalTimestampImpl in class AbstractDBObjectProvider
Returns:
Throws:
DBException

getExternalTimestampByID

protected final java.lang.Long getExternalTimestampByID(DBObjectID id)
                                                 throws DBException
Throws:
DBException

getExternalTimestampByName

protected final java.lang.Long getExternalTimestampByName(java.lang.String type,
                                                          Schema schema,
                                                          java.lang.String objectName)

loadSchemasImpl

protected java.util.Map<java.lang.String,Schema> loadSchemasImpl()
                                                          throws DBException
Throws:
DBException

exists

public final boolean exists(java.lang.String type,
                            java.lang.String schema,
                            java.lang.String name)
Checks whether an object exists in the database. If the dictionary queries for this database returns a query to do this it is used, otherwise getObject() is used.

Specified by:
exists in interface Database
Overrides:
exists in class AbstractDatabase
name - The name of the schema object.
Returns:
true if the object exists, false otherwise.

isObjectValid

public final boolean isObjectValid(java.lang.String objectType,
                                   java.lang.String schema,
                                   java.lang.String objectName)
Description copied from interface: Database
Determines whether the specified database object is in a valid state.

Specified by:
isObjectValid in interface Database
Overrides:
isObjectValid in class AbstractDatabase
Parameters:
objectType - the type of the object.
schema - the name of the schema containing the object
objectName - the name of the object

createByIDImpl

protected final SystemObject createByIDImpl(DBObjectID id)
                                     throws DBException
Overrides:
createByIDImpl in class AbstractDatabase
Throws:
DBException

getAliveTestStatement

protected final java.lang.String getAliveTestStatement()
Description copied from class: AbstractDatabase
Returns a statement that, if executed succesfully, tests whether the given connections is live. The statement must yield a positive return from Statement.execute(java.lang.String) to be a valid test (e.g. SELECT 1 FROM DUAL for Oracle).

Overrides:
getAliveTestStatement in class AbstractDatabase
Returns:

close

public void close()
Description copied from interface: Database
Closes the Database Connection (and the supplied JDBC Connection).

Specified by:
close in interface Database
Overrides:
close in class AbstractDatabase

getUserName

public final java.lang.String getUserName()
Description copied from interface: Database
Retrieves the username used to connect to the database


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.