public abstract class DDLDatabase extends AbstractDatabase
CASE_SENSITIVE_NAME_POLICY, EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, NEW_FROM_TEMPLATE_TYPE, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICYFOUR_GIG, GENERIC_JDBC_DATABASE, PROVIDER_TYPE, SOURCE_TYPE_BODY, SOURCE_TYPE_SPEC, TWO_GIGCREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE, NEW_FROM_TEMPLATE_TYPE| Modifier | Constructor and Description |
|---|---|
protected |
DDLDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn)
Constructs a new DDLDatabase with the given connection information.
|
protected |
DDLDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn,
java.lang.String type,
int version)
Constructs a new DDLDatabase with the given connection information.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCreate(SystemObject object,
boolean replace)
Whether an attempt to create the specified object is likely to succeed.
|
boolean |
canDelete(SystemObject obj,
boolean cascade)
Checks to see whether a specific object can be deleted.
|
protected java.util.Collection<DBObjectChange> |
commitTransaction(DBObjectTransaction txn,
Difference listDiff)
Implement to commit the given transaction's difference.
|
void |
createObjects(SystemObject[] 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 |
deleteObjects(SystemObject[] objects,
boolean cascade)
Deletes the objects.
|
void |
deleteSchema(Schema schema,
boolean cascade)
Deletes the schema.
|
protected boolean |
executeDDL(DDL ddl,
boolean ignoreErrors) |
DiffEngine |
getDiffEngine()
Returns a diff engine setup with the appropriate set of differs for
object updating.
|
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()
Retrieves the list of schemas available from this provider regardless of
their visibility to the user.
|
protected void |
processCreateException(DBException dbe,
SystemObject object) |
protected void |
processDeleteException(DBException dbe,
SystemObject object)
When an exception is encountered during delete of an object it may be for
legitimate reasons that we want to ignore (e.g.
|
void |
setCompilerOptions() |
void |
undeleteObject(SchemaObject object)
Undeletes the object, i.e.
|
void |
undeleteObjects(SchemaObject[] objects)
Undeletes the objects, i.e.
|
void |
updateSchema(Schema oldSchema,
Schema newSchema)
Updates the definition of a Schema.
|
cancelStatement, canRestrictSchemaList, clearAllCaches, close, createDuplicateConnection, createID, createID, createSchema, exists, exists, findOrCreateObject, findOrCreateObject, findOrCreateObject, findOrCreateObject, finishCreate, finishDelete, finishUpdates, getAliveTestStatement, getCatalog, getConnection, getConnection, getConnectionName, getConnectionStore, getCreatedObject, getCurrentSchemaName, getDatabaseSource, getDatabaseSource, getDatabaseType, getDatabaseVersion, getDBExceptionMessage, getDefaultSchema, getDescriptor, getName, getObjectImpl, getProviderIdentifier, getProviderType, getQualifiedName, getTransactionTestQuery, getUserName, hasTransaction, isClosed, isConnectionAlive, isConnectionAlive, isConnectionAliveImpl, isConnectionClosed, isConnectionClosedImpl, isObjectValid, isSQLStateNotImplemented, isUnsupportedOperation, isUsernameCaseInsensitive, queryCatalog, queryCurrentSchemaName, queryCurrentUserName, reconnected, registerBuilders, registerValidators, setStatement, supportsDebugging, testSQLStatementaddObjectListener, addObjectListener, addObjectListener, addProviderListener, addProviderListener, cacheObject, canUpdate, checkCachedObject, commitTransaction, convertObject, createObject, createObjectFactory, createObjectManager, deleteObject, destroyCache, ensureSystemObjectListDifference, findObject, findObject, findSchema, fireObjectsAdded, fireObjectsAdded, fireObjectsRemoved, fireObjectsRemoved, fireObjectUpdated, fireProviderClosed, fireProviderDeleted, fireProviderOpened, fireProviderReloaded, fireSchemaAdded, fireSchemaObjectUpdated, fireSchemaRemoved, fireSchemaUpdated, getBuilderForType, getCachedTimestamp, getCascadeManager, getCasePolicy, getDataType, getDDLGenerator, getDefaultSchemaName, getDefaultTemplateForType, getDescription, getExistingTimestamp, getExternalName, getExternalName, getExternalTimestamp, getExternalTimestampImpl, getIdentifierQuoteString, getInternalName, getInternalName, getLogger, getObject, getObject, getObjectFactory, getOrCreateDataType, getPropertyManager, getQuotedNameCasePolicy, getSchema, getSchemaObjectExpanders, getTimestamp, getTimestamp, getUniqueName, getUniqueName, getUniqueNameTreatIndexAsSchemaObject, getValidator, getValidatorForType, hasObjectPrivilege, hasPriviledge, hasSystemPrivilege, isEditable, isNewFromTemplateType, isRequestedObject, isRequestedObject, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjects, listObjectsFromCache, listObjectsImpl, listObjectsImpl, listObjectsImpl, listObjectTypes, listSchemas, listSupportedDataTypes, loadObjectImpl, loadObjectImpl, loadObjectImpl, logEvent, markForLazyInit, markForLazyInit, normaliseType, putCachedTimestampKey, quoteIdentifier, registerBuilder, registerSchemaObjectExpander, registerType, registerValidator, removeObjectListener, removeProviderListener, removeProviderListener, resetObject, resetObject, resolveID, resolveIDImpl, resolveReferenceID, resolveUnspecifiedTypeID, resumeTimestampQueries, setDefaultTemplateForType, supportsObjectType, supportsTimestamps, supportsTimestamps, suspendTimestampQueries, uncacheObject, updateObject, updateObjects, updateObjects, validate, validateName, validateName, validateObject, validateObject, validateObject, validateObject, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateSchema, validateSchema, validateUniqueName, validateUniqueNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIdentifierQuoteStringaddObjectListener, addObjectListener, addObjectListener, addProviderListener, addProviderListener, canUpdate, commitTransaction, createObject, deleteObject, getCascadeManager, getDataType, getDDLGenerator, getDefaultTemplateForType, getDescription, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getObject, getObjectFactory, getOrCreateDataType, getPropertyManager, getSchema, getTimestamp, getTimestamp, getUniqueName, getUniqueName, hasObjectPrivilege, hasPriviledge, hasSystemPrivilege, isEditable, isNewFromTemplateType, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjects, listObjectTypes, listSchemas, listSupportedDataTypes, quoteIdentifier, removeObjectListener, removeProviderListener, removeProviderListener, setDefaultTemplateForType, supportsObjectType, supportsTimestamps, updateObject, updateObjects, updateObjects, validateName, validateName, validateObject, validateObject, validateObject, validateObject, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateSchema, validateSchema, validateUniqueName, validateUniqueNameprotected DDLDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn)
Class of this
instance.connStore - the name of the connection store containing the
connection.connName - the name for the connectionconn - the Connection to wrapprotected DDLDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn,
java.lang.String type,
int version)
AbstractDatabase.getDatabaseType() and AbstractDatabase.getDatabaseVersion() can be
safely called before the DatabaseDescriptor is known.connStore - the name of the connection store containing the
connection.connName - the name for the connectionconn - the Connection to wraptype - the api database type for this database If null version is ignored.version - the api database version for this databasepublic DiffEngine getDiffEngine()
DBObjectProviderProviders which do not support object updating should return null.
getDiffEngine in interface DBObjectProvidergetDiffEngine in class AbstractDBObjectProviderprotected final boolean executeDDL(DDL ddl, boolean ignoreErrors) throws DBException
DBExceptionpublic final boolean canCreate(SystemObject object, boolean replace)
DBObjectProviderobject - the SystemObject 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 canDelete(SystemObject obj, boolean cascade)
DBObjectProviderobj - the object to checkcascade - whether to assume a cascading delete should be used.public final void createSchema(Schema schema, boolean replace) throws DBException
DBObjectProvidercreateSchema in interface DBObjectProvidercreateSchema in class AbstractDBObjectProviderschema - the schema being createdreplace - whether to replace an existing schemaDBException - if an error is encountered creating the schemapublic final void deleteSchema(Schema schema, boolean cascade) throws DBException
DBObjectProviderdeleteSchema in interface DBObjectProviderdeleteSchema in class AbstractDBObjectProviderschema - 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
DBObjectProviderupdateSchema in interface DBObjectProviderupdateSchema in class AbstractDBObjectProvideroldSchema - the old version of the schemanewSchema - the new version of the schemaDBException - if the update failspublic final void createObjects(SystemObject[] objects, boolean replace) throws DBException
DBObjectProviderobjects - the SystemObject[] 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, SystemObject object) throws DBException
DBExceptionprotected boolean isCauseNameInUse(DBException dbe)
public void deleteObjects(SystemObject[] objects, boolean cascade) throws DBException
DBObjectProviderobjects - the objects to deletecascade - whether to delete dependent objectsDBException - if an error is encountered performing the deleteprotected void processDeleteException(DBException dbe, SystemObject object) throws DBException
dbe - the exception to check and re-throw if we don't want to ignore
itobject - the object we're trying to deleteDBException - the re-thrown exception assuming we don't want to
ignore itpublic final void undeleteObject(SchemaObject object) throws DBException
DBObjectProviderobject - the object to be undeletedDBException - if an error is encountered performing the undeletepublic final void undeleteObjects(SchemaObject[] objects) throws DBException
DBObjectProviderobjects - the objects to be undeletedDBException - if an error is encountered performing the undeleteprotected java.util.Collection<DBObjectChange> commitTransaction(DBObjectTransaction txn, Difference listDiff) throws DBException
AbstractDBObjectProvidercommitTransaction in class AbstractDBObjectProvidertxn - the transaction (create/update/delete of objects) to commitlistDiff - the difference detailing the changes that the are in
the transaction and that require commitingDBException - if the commit could not be performedpublic final Schema[] listSchemas() throws DBException
DBObjectProviderlistSchemas in interface DBObjectProviderlistSchemas in class AbstractDBObjectProviderDBException - if an error is encountered listing the schemasDBObjectProvider.listSchemas(boolean)public void setCompilerOptions()