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

E13403-02

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, 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
protected  SchemaObject 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()
           
 java.lang.Long getExternalTimestamp(SchemaObject object)
          Retrieves the timestamp for this object from the database.
protected  java.lang.Long getExternalTimestampByID(DBObjectID id)
           
protected  java.lang.Long getExternalTimestampByName(java.lang.String type, Schema schema, java.lang.String objectName)
           
protected  QueryWrapper[] getListQueries(java.lang.String[] types, Schema schema, java.lang.String ref)
          Retruns a number of query wrapper objects that will list the given object types in the given schema.
protected  java.util.List getParameters(DictionaryQueries.Params[] params, Schema schema, java.lang.String nameref, java.lang.String[] typeList)
           
protected  java.util.List getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.lang.String[] typeList)
           
protected  boolean isConnectionAlive(java.sql.Connection conn)
          Implementation that checks whether the given (current) connection is alive.
protected  boolean isSupportedType(java.lang.String type)
           
protected  java.util.Collection<SchemaObject> listObjectsImpl(java.lang.String[] objectTypes, Schema schema, java.lang.String ref)
          Internal listObjects implementation.
protected  java.util.Map<java.lang.String,Schema> loadSchemasImpl()
          Implementation that should be implemented to load schemas from the database.
protected  QueryWrapper newQueryWrapper(java.lang.String query, java.util.List params)
           
protected  QueryWrapper newQueryWrapper(java.lang.String query, java.lang.Object... params)
           
 void resumeTimestampQueries(java.lang.String key)
          Resums the calls to get the external timestamp for a given object.
 boolean supportsTimestamps()
          Returns true if this database supports timestamping.
 void suspendTimestampQueries(java.lang.String key)
          Limits the call to get the external timestamp for a given object to once until resumeTimestampQueries() is called.
 
Methods inherited from class oracle.javatools.db.ddl.DDLDatabase
cacheSchema, cacheSchema, canCreate, canCreate, canDelete, canDelete, close, createObjects, createSchema, deleteObject, deleteObjects, deleteSchema, executeDDL, getCachedSchema, getDDLGenerator, getDiffEngine, getSchema, isCauseNameInUse, listSchemas, loadAllSchemas, processCreateException, processDeleteException, registerExpanders, throwUnsupportedOperation, throwUnsupportedOperation, uncacheSchema, undeleteObject, undeleteObjects, updateObject, updateObjects, updateObjects, updateSchema
 
Methods inherited from class oracle.javatools.db.AbstractDatabase
cancelStatement, canRestrictSchemaList, createSchema, exists, finishCreate, finishDelete, finishDelete, getConnection, getConnection, getConnectionName, getConnectionStore, getCreatedObject, getDatabaseSource, getDatabaseSource, getDefaultSchema, getDescriptor, getName, getObjectImpl, getQualifiedName, getTransactionTestQuery, hasTransaction, isConnectionAlive, isObjectValid, isUsernameCaseInsensitive, listSchemas, reconnect, reconnected, registerBuilders, registerValidators, sqlTrace, sqlTrace, supportsDebugging
 
Methods inherited from class oracle.javatools.db.AbstractDBObjectProvider
addProviderListener, cacheObject, clearAllCaches, clearCache, convertObject, createObject, createObjectManager, createSchemaObjectImpl, destroyCache, findByID, findObject, findObject, fireObjectsAdded, fireObjectsRemoved, fireProviderClosed, fireProviderDeleted, fireProviderOpened, fireProviderReloaded, fireSchemaAdded, fireSchemaObjectUpdated, fireSchemaRemoved, fireSchemaUpdated, getBuilderForType, getCasePolicy, getDataType, getDefaultTemplateForType, getExternalName, getExternalName, getIdentifierQuoteString, getInternalName, getInternalName, getLogger, getObject, getObjectManager, getOrCreateDataType, getPropertyManager, getQuotedNameCasePolicy, getSchemaObjectExpanders, getTimestamp, getTimestamp, getUniqueName, getValidatorForType, hasPriviledge, isEditable, isNewFromTemplateType, isRequestedObject, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjectsFromCache, listObjectsImpl, listObjectTypes, listSupportedDataTypes, logEvent, markForLazyInit, normaliseType, quoteIdentifier, registerBuilder, registerSchemaObjectExpander, registerType, registerValidator, removeProviderListener, resetSchemaObject, schemaUpdated, setDefaultTemplateForType, supportsObjectType, uncacheObject, unregisterBuilder, unregisterValidator, validateName, validateName, validateObject, validateObject, validateObject, validateObject, 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
getDatabaseType, getIdentifierQuoteString, getUserName
 
Methods inherited from interface oracle.javatools.db.DBObjectProvider
addProviderListener, createObject, getDataType, getDefaultTemplateForType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getObjectManager, getOrCreateDataType, getTimestamp, getTimestamp, getUniqueName, hasPriviledge, isEditable, isNewFromTemplateType, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjectTypes, listSupportedDataTypes, quoteIdentifier, removeProviderListener, setDefaultTemplateForType, supportsObjectType, validateName, validateName, validateObject, validateObject, validateObject, validateObject, 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()
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
See Also:
AbstractDBObjectProvider.TIMESTAMP_PROPERTY

suspendTimestampQueries

public void suspendTimestampQueries(java.lang.String key)
Limits the call to get the external timestamp for a given object to once until resumeTimestampQueries() is called. This means that once queried the first time, if an object is changed in the database the API will not notice.

For internal use only. Application developers should not use this

resumeTimestampQueries

public void resumeTimestampQueries(java.lang.String key)
Resums the calls to get the external timestamp for a given object. The key passed in must match that passed into suspendTimestampQueries and the number of keys must reach zero before timestamping will resume.

For internal use only. Application developers should not use this

getListQueries

protected QueryWrapper[] getListQueries(java.lang.String[] types,
                                        Schema schema,
                                        java.lang.String ref)
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 final java.util.Collection<SchemaObject> listObjectsImpl(java.lang.String[] objectTypes,
                                                                   Schema schema,
                                                                   java.lang.String ref)
                                                            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 getParameters(DictionaryQueries.Params[] params,
                                             Schema schema,
                                             java.lang.String nameref,
                                             java.lang.String[] typeList)

getParameters

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

getExternalTimestamp

public final java.lang.Long getExternalTimestamp(SchemaObject object)
                                          throws DBException
Retrieves the timestamp for this object from the database.

Overrides:
getExternalTimestamp 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
Description copied from class: DDLDatabase
Implementation that should be implemented to load schemas from the database.

Specified by:
loadSchemasImpl in class DDLDatabase
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.

createByIDImpl

protected final SchemaObject 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:

isConnectionAlive

protected boolean isConnectionAlive(java.sql.Connection conn)
Description copied from class: AbstractDatabase
Implementation that checks whether the given (current) connection is alive. Implementations should not call AbstractDatabase.getConnection() or similar, and only check the passed Connection object.

Overrides:
isConnectionAlive in class AbstractDatabase
Parameters:
conn - the connection to check (will not be null).
Returns:
whether the given connection is alive.

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

E13403-02

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