|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.javatools.db.AbstractDBObjectProvider
oracle.javatools.db.AbstractDatabase
oracle.javatools.db.ddl.DDLDatabase
public abstract class DDLDatabase
Database implementation that uses a DDLGenerator to create, update and delete objects.
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 |
DDLDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn)
|
Method Summary | |
---|---|
protected void |
cacheSchema(java.lang.String name,
Schema schema)
|
protected void |
cacheSchema(java.lang.String name,
Schema schema,
boolean pin)
|
boolean |
canCreate(Schema schema,
boolean replace)
Whether an attempt to create the specified schema is likely to succeed. |
boolean |
canCreate(SchemaObject object,
boolean replace)
Whether an attempt to create the specified object is likely to succeed. |
boolean |
canDelete(Schema schema,
boolean cascade)
Checks to see whether a specific schema can be deleted. |
boolean |
canDelete(SchemaObject obj,
boolean cascade)
Checks to see whether a specific object can be deleted. |
void |
close()
Closes the Database Connection (and the supplied JDBC Connection). |
void |
createObjects(SchemaObject[] objects,
boolean replace)
Causes the creation of the objects described by the specified meta data. |
void |
createSchema(Schema schema,
boolean replace)
Causes the creation of a new Schema in the persistent storage. |
void |
deleteObject(SchemaObject object,
boolean cascade)
Deletes the object. |
void |
deleteObjects(SchemaObject[] objects,
boolean cascade)
Deletes the objects. |
void |
deleteSchema(Schema schema,
boolean cascade)
Deletes the schema. |
protected boolean |
executeDDL(DDL ddl,
boolean ignoreErrors)
|
protected Schema |
getCachedSchema(java.lang.String name)
|
DDLGenerator |
getDDLGenerator()
Gets the DDLGenerator for this DDLDatabase implementation. |
DiffEngine |
getDiffEngine()
Returns a diff engine setup with the appropriate set of differs for object updating. |
Schema |
getSchema(java.lang.String name)
Retrieves the Schema object associated with a specific name. |
protected boolean |
isCauseNameInUse(DBException dbe)
Used by processCreateException to determine whether the given failure in DDL execution should be rolled back (i.e. |
Schema[] |
listSchemas()
Executes a query to retrive the schemas defined by this database. |
protected boolean |
loadAllSchemas(boolean force)
Loads the schemas from the database. |
protected abstract java.util.Map<java.lang.String,Schema> |
loadSchemasImpl()
Implementation that should be implemented to load schemas from the database. |
protected void |
processCreateException(DBException dbe,
SchemaObject object)
|
protected void |
processDeleteException(DBException dbe,
SchemaObject object)
|
protected void |
registerExpanders()
|
protected void |
throwUnsupportedOperation(java.lang.String msg,
DBObject... objs)
|
protected void |
throwUnsupportedOperation(java.lang.UnsupportedOperationException base,
DBObject... objs)
|
protected boolean |
uncacheSchema(java.lang.String name)
|
void |
undeleteObject(SchemaObject object)
Undeletes the object, i.e. |
void |
undeleteObjects(SchemaObject[] objects)
Undeletes the objects, i.e. |
void |
updateObject(SchemaObject oldObject,
SchemaObject newObject)
Updates the definition of an object. |
void |
updateObjects(ResultSet rs,
boolean replace,
boolean cascade)
Updates the definition of a set of objects. |
void |
updateObjects(SchemaObject[] oldObjects,
SchemaObject[] newObjects)
Updates the definition of a set of objects. |
void |
updateSchema(Schema oldSchema,
Schema newSchema)
Updates the definition of a Schema. |
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 |
Constructor Detail |
---|
protected DDLDatabase(java.lang.String connStore, java.lang.String connName, java.sql.Connection conn)
Method Detail |
---|
public DDLGenerator getDDLGenerator()
DatabaseDescriptor.getDDLGenerator(oracle.javatools.db.DBObjectProvider)
.
getDDLGenerator
in class AbstractDatabase
public DiffEngine getDiffEngine()
DBObjectProvider
Providers which do not support object updating should return null.
getDiffEngine
in interface DBObjectProvider
getDiffEngine
in class AbstractDBObjectProvider
protected final boolean executeDDL(DDL ddl, boolean ignoreErrors) throws DBException
DBException
protected void throwUnsupportedOperation(java.lang.UnsupportedOperationException base, DBObject... objs) throws DBException
DBException
protected void throwUnsupportedOperation(java.lang.String msg, DBObject... objs) throws DBException
DBException
public final boolean canCreate(SchemaObject object, boolean replace)
DBObjectProvider
object
- the SchemaObject describing the object to createreplace
- whether to replace an existing object. If
replace
is false and the object exists, canCreate must
return false.
public final boolean canCreate(Schema schema, boolean replace)
DBObjectProvider
schema
- the Schema describing the object to createreplace
- whether to replace an existing schema. If
replace
is false and the schema exists, canCreate must
return false.
public final boolean canDelete(Schema schema, boolean cascade)
DBObjectProvider
schema
- the object to checkcascade
- whether to assume a cascading delete should be used.
public final boolean canDelete(SchemaObject obj, boolean cascade)
DBObjectProvider
obj
- the object to checkcascade
- whether to assume a cascading delete should be used.
public final void createSchema(Schema schema, boolean replace) throws DBException
DBObjectProvider
schema
- the schema being createdreplace
- whether to replace an existing schema
DBException
- if an error is encountered creating the schemapublic final void deleteSchema(Schema schema, boolean cascade) throws DBException
DBObjectProvider
schema
- the schema to deletecascade
- whether to delete dependent objects (i.e. all SchemaObjects
contained in the Schema).
DBException
- if an error is encountered performing the deletepublic final void updateSchema(Schema oldSchema, Schema newSchema) throws DBException
DBObjectProvider
oldSchema
- the old version of the schemanewSchema
- the new version of the schema
DBException
- if the update failspublic final void createObjects(SchemaObject[] objects, boolean replace) throws DBException
DBObjectProvider
objects
- the SchemaObject[] describing the objects to create.replace
- whether to replace an existing objects. If
replace
is false and the object exists, createObjects will
fail.
DBException
- if an error is encountered creating the objects.protected void processCreateException(DBException dbe, SchemaObject object) throws DBException
DBException
protected boolean isCauseNameInUse(DBException dbe)
public final void deleteObject(SchemaObject object, boolean cascade) throws DBException
DBObjectProvider
deleteObject
in interface DBObjectProvider
deleteObject
in class AbstractDBObjectProvider
object
- the object to deletecascade
- whether to delete dependent objects
DBException
- if an error is encountered performing the deletepublic void deleteObjects(SchemaObject[] objects, boolean cascade) throws DBException
DBObjectProvider
objects
- the objects to deletecascade
- whether to delete dependent objects
DBException
- if an error is encountered performing the deleteprotected void processDeleteException(DBException dbe, SchemaObject object) throws DBException
DBException
public final void undeleteObject(SchemaObject object) throws DBException
DBObjectProvider
object
- the object to be undeleted
DBException
- if an error is encountered performing the undeletepublic final void undeleteObjects(SchemaObject[] objects) throws DBException
DBObjectProvider
objects
- the objects to be undeleted
DBException
- if an error is encountered performing the undeletepublic final void updateObject(SchemaObject oldObject, SchemaObject newObject) throws DBException
DBObjectProvider
updateObject
in interface DBObjectProvider
updateObject
in class AbstractDBObjectProvider
oldObject
- the old version of the objectnewObject
- the new version of the object
DBException
- if the update failspublic final void updateObjects(SchemaObject[] oldObjects, SchemaObject[] newObjects) throws DBException
DBObjectProvider
updateObjects
in interface DBObjectProvider
updateObjects
in class AbstractDBObjectProvider
DBException
- if the update failspublic final void updateObjects(ResultSet rs, boolean replace, boolean cascade) throws DBException
DBObjectProvider
ResultSet
which
must have been created using the DiffEngine
returned by
DBObjectProvider.getDiffEngine()
The 'change' maybe to create, alter, or delete
objects.
rs
- the changes described as a ResultSet
- this should be a
LIST ResultSet with the old objects as a() and the new objects as b().replace
- true if an existing object is to be replaced (when creating)cascade
- true if cascade delete should be used to replace an object
(when deleting)
DBException
protected void registerExpanders()
registerExpanders
in class AbstractDBObjectProvider
public Schema getSchema(java.lang.String name) throws DBException
DBObjectProvider
name
- a string containing the name of the schema
DBException
- if an error is encountered getting the schemapublic final Schema[] listSchemas() throws DBException
DBException
DBObjectProvider.listSchemas(boolean)
protected final boolean loadAllSchemas(boolean force) throws DBException
DBException
protected abstract java.util.Map<java.lang.String,Schema> loadSchemasImpl() throws DBException
DBException
protected final void cacheSchema(java.lang.String name, Schema schema)
protected final void cacheSchema(java.lang.String name, Schema schema, boolean pin)
protected final boolean uncacheSchema(java.lang.String name)
protected final Schema getCachedSchema(java.lang.String name)
public void close()
Database
close
in interface Database
close
in class AbstractDatabase
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |