public abstract class DictionaryDatabase extends DDLDatabase
DictionaryQueriesCASE_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 |
DictionaryDatabase(java.lang.String connStore, java.lang.String connName, java.sql.Connection conn) |
| Modifier and Type | Method and Description |
|---|---|
protected SystemObject |
createByIDImpl(DBObjectID 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, BaseObjectID id)
Converts the given required parameters in to a list of Strings ready to pass to a QueryWrapper.
|
protected java.util.List<java.lang.String> |
getParameters(DictionaryQueries.Params[] params, java.lang.Object identifier, java.lang.String schema, java.lang.String nameref, java.lang.String... typeList)
Converts the given required parameters in to a list of Strings ready to pass to a QueryWrapper.
|
protected java.util.List<java.lang.String> |
getParameters(DictionaryQueries.Params[] params, Schema schema, java.lang.String nameref, java.lang.String... typeList)
Converts the given required parameters in to a list of Strings ready to pass to a QueryWrapper.
|
protected java.util.List<java.lang.String> |
getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.util.Collection<java.lang.String> typeList)
Converts the given required parameters in to a list of Strings ready to pass to a QueryWrapper.
|
protected java.util.List<java.lang.String> |
getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.lang.String... typeList)
Converts the given required parameters in to a list of Strings ready to pass to a QueryWrapper.
|
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> |
listObjectsImpl(DBObjectCriteria<T> criteria)
Internal listObjects implementation.
|
protected QueryWrapper |
newQueryWrapper(SystemObject obj, java.lang.String query, java.util.List params) |
protected QueryWrapper |
newQueryWrapper(SystemObject obj, java.lang.String query, java.lang.Object... params) |
protected java.lang.String |
queryCurrentUserName() |
boolean |
supportsTimestamps(java.lang.String objectType)
Returns true if this database supports timestamping.
|
canCreate, canDelete, commitTransaction, createObjects, createSchema, deleteObjects, deleteSchema, executeDDL, getDiffEngine, isCauseNameInUse, listObjectsImpl, listSchemas, processCreateException, processDeleteException, setCompilerOptions, undeleteObject, undeleteObjects, updateSchemacancelStatement, canRestrictSchemaList, clearAllCaches, close, createID, createID, createSchema, exists, findOrCreateObject, findOrCreateObject, findOrCreateObject, finishCreate, finishDelete, finishUpdates, 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, isConnectionClosed, isSQLStateNotImplemented, isUnsupportedOperation, isUsernameCaseInsensitive, queryCatalog, queryCurrentSchemaName, reconnect, reconnected, registerBuilders, registerValidators, setStatement, sqlTrace, sqlTrace, supportsDebugging, testSQLStatementaddObjectListener, addObjectListener, addObjectListener, addProviderListener, addProviderListener, cacheObject, canUpdate, checkCachedObject, commitTransaction, convertObject, createObject, createObjectImpl, createObjectManager, deleteObject, destroyCache, ensureSystemObjectListDifference, findByID, findObject, findObject, findSchema, fireObjectsAdded, fireObjectsAdded, fireObjectsRemoved, fireObjectsRemoved, fireObjectUpdated, fireProviderClosed, fireProviderDeleted, fireProviderOpened, fireProviderReloaded, fireSchemaAdded, fireSchemaObjectUpdated, fireSchemaRemoved, fireSchemaUpdated, getBuilderForType, getCachedTimestamp, getCascadeManager, getCasePolicy, getDataType, getDDLGenerator, getDefaultTemplateForType, getDescription, getExistingTimestamp, getExternalName, getExternalName, getExternalTimestamp, getIdentifierQuoteString, getInternalName, getInternalName, getLogger, getObject, getObject, getObjectFactory, getObjectManager, getOrCreateDataType, getPropertyManager, getQuotedNameCasePolicy, getSchema, getSchemaObjectExpanders, getTimestamp, getTimestamp, getUniqueName, getUniqueNameTreatIndexAsSchemaObject, getValidatorForType, hasObjectPrivilege, hasPriviledge, hasSystemPrivilege, 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, removeObjectListener, removeProviderListener, removeProviderListener, resetObject, resetObject, resumeTimestampQueries, setDefaultTemplateForType, supportsObjectType, supportsTimestamps, suspendTimestampQueries, uncacheObject, updateObject, updateObjects, updateObjects, 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, getObjectManager, getOrCreateDataType, getPropertyManager, getSchema, getTimestamp, getTimestamp, getUniqueName, hasObjectPrivilege, hasPriviledge, hasSystemPrivilege, isEditable, isNewFromTemplateType, isValidName, isValidName, listObjects, listObjects, listObjects, listObjects, listObjects, listObjectTypes, listSchemas, listSupportedDataTypes, quoteIdentifier, removeObjectListener, removeProviderListener, removeProviderListener, setDefaultTemplateForType, supportsObjectType, updateObject, updateObjects, updateObjects, validateName, validateName, validateObject, validateObject, validateObject, validateObject, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateObjectProperty, validateSchema, validateSchema, validateUniqueName, validateUniqueName
protected DictionaryDatabase(java.lang.String connStore,
java.lang.String connName,
java.sql.Connection conn)
protected QueryWrapper newQueryWrapper(SystemObject obj, java.lang.String query, java.lang.Object... params)
protected QueryWrapper newQueryWrapper(SystemObject obj, java.lang.String query, java.util.List params)
protected abstract DictionaryQueries getDictionaryQueries()
protected boolean isSupportedType(java.lang.String type)
public boolean supportsTimestamps(java.lang.String objectType)
supportsTimestamps in interface DBObjectProvidersupportsTimestamps in class AbstractDBObjectProviderprotected QueryWrapper[] getListQueries(DBObjectCriteria<? extends SystemObject> criteria)
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.
protected <T extends SystemObject> java.util.Collection<T> listObjectsImpl(DBObjectCriteria<T> criteria) throws DBException
AbstractDBObjectProviderlistObjectsImpl in class AbstractDBObjectProviderDBExceptionprotected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, Schema schema, java.lang.String nameref, java.lang.String... typeList)
params - the required query parametersschema - the Schema to use if the SCHEMA parameter is included.nameref - the name (or name like expression) to use if the NAMEREF parameter is included.typeList - the list of types (or single type) to use if the TYPE or TYPELIST parameter is included.protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.util.Collection<java.lang.String> typeList)
params - the required query parametersschema - the schema name to use if the SCHEMA parameter is included.nameref - the name (or name like expression) to use if the NAMEREF parameter is included.typeList - the list of types (or single type) to use if the TYPE or TYPELIST parameter is included.protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, java.lang.String schema, java.lang.String nameref, java.lang.String... typeList)
params - the required query parametersschema - the schema name to use if the SCHEMA parameter is included.nameref - the name (or name like expression) to use if the NAMEREF parameter is included.typeList - the list of types (or single type) to use if the TYPE or TYPELIST parameter is included.protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, BaseObjectID id)
params - the required query parametersid - the object ID to use to get the schema, type, name and identifier parameters.protected final java.util.List<java.lang.String> getParameters(DictionaryQueries.Params[] params, java.lang.Object identifier, java.lang.String schema, java.lang.String nameref, java.lang.String... typeList)
params - the required query parametersidentifier - the object identifier to use if the IDENTIFIER parameter is included.schema - the schema name to use if the SCHEMA parameter is included.nameref - the name (or name like expression) to use if the NAMEREF parameter is included.typeList - the list of types (or single type) to use if the TYPE or TYPELIST parameter is included.protected final java.lang.Long getExternalTimestampImpl(SystemObject obj) throws DBException
getExternalTimestampImpl in class AbstractDBObjectProviderDBExceptionprotected final java.lang.Long getExternalTimestampByID(DBObjectID id) throws DBException
DBException
protected final java.lang.Long getExternalTimestampByName(java.lang.String type,
Schema schema,
java.lang.String objectName)
public final boolean exists(java.lang.String type,
java.lang.String schema,
java.lang.String name)
exists in interface Databaseexists in class AbstractDatabasename - The name of the schema object.true if the object exists, false otherwise.
public final boolean isObjectValid(java.lang.String objectType,
java.lang.String schema,
java.lang.String objectName)
DatabaseisObjectValid in interface DatabaseisObjectValid in class AbstractDatabaseobjectType - the type of the object.schema - the name of the schema containing the objectobjectName - the name of the objectprotected final SystemObject createByIDImpl(DBObjectID id) throws DBException
createByIDImpl in class AbstractDatabaseDBExceptionprotected final java.lang.String getAliveTestStatement()
AbstractDatabaseStatement.execute(java.lang.String) to be a valid test (e.g. SELECT 1 FROM DUAL for Oracle).getAliveTestStatement in class AbstractDatabase
protected java.lang.String queryCurrentUserName()
throws DBException
queryCurrentUserName in class AbstractDatabaseDBException