Extension SDK 9.0.5

oracle.jdeveloper.cm.ds.db
Class AbstractDatabase

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
      extended byoracle.jdeveloper.cm.ds.db.AbstractDatabase
All Implemented Interfaces:
Database, DBObjectProvider, Observer
Direct Known Subclasses:
JdbcDatabase

public abstract class AbstractDatabase
extends AbstractDBObjectProvider
implements Database, Observer

Base implementation of the Database interface. AbstractDatabase can be subclassed to provide support for specific types of databases.

Since:
9.0.5
See Also:
JdbcDatabase, BaseOracleDatabase

Field Summary
static java.lang.String SQLSTATE_NOT_IMPLEMENTED
           
 
Fields inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.Database
GENERIC_JDBC_DATABASE
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObjectProvider
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE
 
Constructor Summary
protected AbstractDatabase(java.lang.String connName, java.sql.Connection conn)
          Constructs a new AbstractDatabase.
 
Method Summary
 void close()
          Closes the Database Connection (and the supplied JDBC Connection).
 void createObjects(SchemaObject[] objects, boolean replace)
          Default implementation of this method simply iterates through the objects calling createObject on each.
protected  Schema createSchema(java.lang.String name)
           
 void deleteObjects(SchemaObject[] objects, boolean cascade)
          Default implementation of this method simply iterates through the objects calling createObject on each.
protected  boolean exists(SchemaObject obj)
          Whether the specified object exists.
 boolean exists(java.lang.String type, java.lang.String schema, java.lang.String name)
          Checks for existance of a schema object named objectName.
 java.sql.Connection getConnection()
          Gets the JDBC connection associated with this database.
 java.lang.String getConnectionName()
          Retrieves the ConnectionManager name for the Connection associated with this Database.
 java.lang.String getDatabaseSource(java.lang.String objectType, Schema schema, java.lang.String objectName)
          Retrieves the source for an object in the database.
protected  DDLGenerator getDDLGenerator()
          Retrieves the DDLGenerator used by default.
 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 abstract  void registerBuilders()
          Called to request that the DBOBjectBuilders be registered.
protected abstract  void registerDataTypes()
          Called to request that the datatypes be registered.
protected  void setDDLGenerator(DDLGenerator gen)
          Sets the DDLGenerator used by default.
 void update(java.lang.Object observed, UpdateMessage msg)
          Notification message.
 void updateObjects(SchemaObject[] oldObjects, SchemaObject[] newObjects)
          Default implementation of this method simply iterates through the objects calling createObject on each.
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
addDataType, cacheObject, canCreate, canCreate, canDelete, canDelete, clearAllCaches, clearCache, convertObject, convertToExternal, convertToInternal, createObject, createSchema, deleteObject, deleteSchema, findByID, findObject, findSupportedDataType, getBuilderForType, getCasePolicy, getDataType, getExternalName, getExternalName, getIdentifierQuoteString, getInternalName, getInternalName, getObject, getSchema, getUniqueName, getValidatorForType, hasPriviledge, initializeDataTypes, isValidName, listObjects, listObjects, listObjectsImpl, listObjectTypes, listSchemas, listSupportedDataTypes, needsQuoting, quoteIdentifier, registerBuilder, registerValidator, removeDataType, uncacheObject, unregisterBuilder, unregisterValidator, updateObject, updateSchema, validateObject, validateObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.cm.ds.db.Database
getDatabaseType, getIdentifierQuoteString, getTimestamp, getUserName, supportsDebugging
 
Methods inherited from interface oracle.jdeveloper.cm.ds.db.DBObjectProvider
canCreate, canCreate, canDelete, canDelete, createObject, createSchema, deleteObject, deleteSchema, getDataType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getSchema, getUniqueName, hasPriviledge, isValidName, listObjects, listObjects, listObjectTypes, listSchemas, listSupportedDataTypes, quoteIdentifier, updateObject, updateSchema, validateObject, validateObject
 

Field Detail

SQLSTATE_NOT_IMPLEMENTED

public static final java.lang.String SQLSTATE_NOT_IMPLEMENTED
See Also:
Constant Field Values
Constructor Detail

AbstractDatabase

protected AbstractDatabase(java.lang.String connName,
                           java.sql.Connection conn)
Constructs a new AbstractDatabase.

Parameters:
connName - a String containing the ConnectionManager name for the connection associated with this Database
conn - the Connection used by this AbstractDatabase
Method Detail

setDDLGenerator

protected void setDDLGenerator(DDLGenerator gen)
Sets the DDLGenerator used by default.

Parameters:
gen - The DDLGenerator to use for generating DDL

getDDLGenerator

protected DDLGenerator getDDLGenerator()
Retrieves the DDLGenerator used by default.

Returns:
the DDLGenerator used for generating DDL

exists

protected boolean exists(SchemaObject obj)
Whether the specified object exists.

Parameters:
obj - The object being checked
Returns:
whether the object exists.

registerBuilders

protected abstract void registerBuilders()
Called to request that the DBOBjectBuilders be registered.


registerDataTypes

protected abstract void registerDataTypes()
Called to request that the datatypes be registered.


getConnection

public java.sql.Connection getConnection()
Description copied from interface: Database
Gets the JDBC connection associated with this database.

Specified by:
getConnection in interface Database
Returns:
The Connection owned by this database object

getConnectionName

public java.lang.String getConnectionName()
Description copied from interface: Database
Retrieves the ConnectionManager name for the Connection associated with this Database.

Specified by:
getConnectionName in interface Database
Returns:
a String containing the connection name

close

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

Specified by:
close in interface Database

exists

public boolean exists(java.lang.String type,
                      java.lang.String schema,
                      java.lang.String name)
Description copied from interface: Database
Checks for existance of a schema object named objectName.

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

isObjectValid

public 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
Parameters:
schema - the name of the schema containing the object
objectName - the name of the object
objectType - the type of the object.

createSchema

protected final Schema createSchema(java.lang.String name)

update

public void update(java.lang.Object observed,
                   UpdateMessage msg)
Description copied from interface: Observer
Notification message. Subjects call this method when they notify their observers that the subjects state has changed.

Specified by:
update in interface Observer
Parameters:
observed - the subject whose state has changed.
msg - what has changed.

createObjects

public void createObjects(SchemaObject[] objects,
                          boolean replace)
                   throws DBException
Default implementation of this method simply iterates through the objects calling createObject on each. Subclasses should provide a more concrete implementation.

Specified by:
createObjects in interface DBObjectProvider
Specified by:
createObjects in class AbstractDBObjectProvider
Throws:
DBException

deleteObjects

public void deleteObjects(SchemaObject[] objects,
                          boolean cascade)
                   throws DBException
Default implementation of this method simply iterates through the objects calling createObject on each. Subclasses should provide a more concrete implementation.

Specified by:
deleteObjects in interface DBObjectProvider
Specified by:
deleteObjects in class AbstractDBObjectProvider
Throws:
DBException

updateObjects

public void updateObjects(SchemaObject[] oldObjects,
                          SchemaObject[] newObjects)
                   throws DBException
Default implementation of this method simply iterates through the objects calling createObject on each. Subclasses should provide a more concrete implementation.

Specified by:
updateObjects in interface DBObjectProvider
Specified by:
updateObjects in class AbstractDBObjectProvider
Throws:
DBException

getDatabaseSource

public java.lang.String getDatabaseSource(java.lang.String objectType,
                                          Schema schema,
                                          java.lang.String objectName)
                                   throws DBException
Description copied from interface: Database
Retrieves the source for an object in the database. The specified object is assumed to be of some type that represents source; non-source based objects will return null.

Specified by:
getDatabaseSource in interface Database
Parameters:
objectType - The type of object for which the source is needed
schema - The Schema containing the object
objectName - The name of the object
Returns:
The source representing the object
Throws:
DBException - if an error occurs fetching the source

Extension SDK

 

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