Package com.im.commons.db
Interface DatabasePlatformX
-
- All Superinterfaces:
DatabasePlatform
- All Known Implementing Classes:
AbstractDatabasePlatform
public interface DatabasePlatformX extends DatabasePlatform
DO NOT USE THIS INTERFACE OUTSIDE db_commons MODULE!!! This is temporary interface. It's purpose is to separate methods of database platform that are used in db_commons module from those used in client modules. DatabasePlatform is interface used by client modules. DatabasePlatformX is interface used by db_commons module. This interface should be made module-private, but it was not possible, because AspectJ part of DIF module build was failing (I will look at this more closely). Also, this interface is used from several client unit tests, I didn't want to add methods used in those tests to client-used DatabasePlatform interface just because they are used in tests. Some refactoring of tests might help with this.- Author:
- Martin Adamek
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IJC_AUTHORITIES_TABLE_NAME
static java.lang.String
IJC_CHANGE_LOG_TABLE_NAME
static java.lang.String
IJC_INVOCATION_LOG_TABLE_NAME
static java.lang.String
IJC_ITEM_INFO_TABLE_NAME
static java.lang.String
IJC_ITEM_USER_TABLE_NAME
static java.lang.String
IJC_SCHEMA_AUTHORITIES_TABLE_NAME
static java.lang.String
IJC_SCHEMA_TABLE_NAME
static java.lang.String
IJC_SECURITY_AUTHORITIES_TABLE_NAME
static java.lang.String
IJC_SECURITY_INFO_TABLE_NAME
static java.lang.String
IJC_SECURITY_USERS_TABLE_NAME
static java.lang.String
IJC_USER_TABLE_NAME
static java.lang.String
IJC_VIEWS_BACKUP_TABLE_NAME
Renamed IJC_VIEWS.static java.lang.String
IJC_VIEWS_SEQUENCE_NAME
static java.lang.String
IJC_VIEWS_TABLE_NAME
Deprecated.Since 5.12, this table is an empty stub for older versions, which try to create the tables just after connecting to the database.-
Fields inherited from interface com.im.commons.db.DatabasePlatform
IJC_API_KEYS_TABLE_NAME, IJC_CONNECT_ITEMS_TABLE_NAME, IJC_CONNECT_STRUCTURES_TABLE_NAME, IJC_SCHEMA_OTHER_SHARING_TABLE_NAME, IJC_SCHEMA_OTHER_TABLE_NAME, NAME_PRIMARY_KEY_CONSTRAINT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.String
createIdColumnNameFromTableName(java.lang.String tableName)
java.lang.String
getCartridgeOwner()
Get the user that owns the JChem cartridge functions.java.lang.String
getCatalog()
java.lang.String
getColumnListCommaSeparated(java.lang.String[] columns)
java.lang.String
getInClause(int numItems)
java.util.List<java.lang.String>
getMetaTableNamesSorted()
java.lang.String
sqlAlterColumnDefault(SchemaQualifiedName tableName, java.lang.String columnName, java.lang.Class colClass, java.lang.String nativeType, java.lang.String columnDefinition, java.lang.String defaultValue, boolean required)
java.lang.String
sqlAlterColumnDefault(java.lang.String tableName, java.lang.String columnName, java.lang.String nativeType, java.lang.String columnDefinition, java.lang.String defaultValue, boolean required)
java.lang.String
sqlAlterColumnName(java.lang.String tableName, java.lang.String oldName, java.lang.String newName, java.lang.String definition)
java.lang.String
sqlAlterColumnSize(java.lang.String tableName, java.lang.String columnName, java.lang.String columnDefinition)
java.lang.String
sqlAlterTableName(java.lang.String oldName, java.lang.String newName)
java.lang.String
sqlCreateFakeIJCViewsTable()
During upgrade to 5.12, the IJC_VIEWS was renamed to IJC_VIEWS_BACKUP.java.lang.String
sqlCreateIJCApiKeysTable()
java.lang.String
sqlCreateIJCAuthoritiesTable()
java.lang.String[]
sqlCreateIJCChangesLogTable()
java.lang.String[]
sqlCreateIJCConnectCustomItemsTable()
java.lang.String
sqlCreateIJCConnectStructureMappingTable()
java.lang.String
sqlCreateIJCGenericsSharingTable()
java.lang.String
sqlCreateIJCGenericsTable()
Deprecated.java.lang.String
sqlCreateIJCGenericsTableV512()
java.lang.String[]
sqlCreateIJCInvocationLogTable()
java.lang.String
sqlCreateIJCItemInfoTable()
java.lang.String
sqlCreateIJCItemUserTable()
java.lang.String
sqlCreateIJCSchemaAuthoritiesTable()
java.lang.String
sqlCreateIJCSchemaTable()
java.lang.String
sqlCreateIJCSecurityAuthoritiesAuthoritiesFK()
java.lang.String
sqlCreateIJCSecurityInfoTable()
java.lang.String
sqlCreateIJCUserTable()
java.lang.String
sqlCreateIJCViewsTable()
Deprecated.Use IJC_CUSTOM_ITEMS.java.lang.String
sqlCreateTable(java.lang.String tableName, java.lang.String idColumnName, java.lang.String extraCols)
java.lang.String
sqlCreateTable(java.lang.String schemaPlusTable, java.util.List<DBDatabaseInfo.NativeType> columnDefs, java.util.List<java.lang.String> columnNames)
Creates a table with the given name and the fields.java.lang.String
sqlCreateView(java.lang.String viewName, java.lang.String sql)
java.lang.String
sqlDataColumn()
java.lang.String
sqlDeleteSharing()
java.lang.String
sqlDropColumn(java.lang.String tableName, java.lang.String columnName)
java.lang.String
sqlDropView(java.lang.String viewName)
java.lang.String
sqlGenericItemInsertV511()
Deprecated.java.lang.String
sqlGetDBSchemaVersion()
java.lang.String
sqlInsertSharing()
java.lang.String
sqlQueryForCustomItemSharing()
java.lang.String
sqlRetrieveSequence(java.lang.String sequenceName)
java.lang.String
sqlSchemaMetaDataInsert()
java.lang.String
sqlSchemaMetaDataNextIndex()
java.lang.String
sqlSelectFromIjcAuthorities()
java.lang.String
sqlSelectFromIjcCustomItems()
java.lang.String
sqlSelectFromIjcItemInfo()
java.lang.String
sqlSelectFromIjcItemUser()
java.lang.String
sqlSelectFromIjcItemUserByUser()
java.lang.String
sqlSelectFromIjcSchema()
java.lang.String
sqlSelectFromIjcSchemaByType()
java.lang.String
sqlSelectFromIjcSecurityInfo()
java.lang.String
sqlSetDBSchemaVersion(boolean insert)
java.lang.String
sqlUpdatePasswordColumn(int size)
java.lang.String
sqlViewMetaDataInsert()
Deprecated.Use IJC_CUSTOM_ITEMS.-
Methods inherited from interface com.im.commons.db.DatabasePlatform
buildColumnInfoForColumn, buildColumnInfosForTable, buildConstraintInfosForTable, buildExportedForeignKeyInfoForTable, buildImportedForeignKeyInfoForTable, buildIndexInfoForTable, buildJChemPropertyTableNames, buildSequenceInfo, buildSequenceInfo, buildTableInfo, buildTableInfoFull, buildTableInfos, buildTableInfosEager, buildTableInfosLazy, checkSchemaExistence, executeDDL, executeDDL, getAddAuthoritySql, getAddUserRoleSql, getAddUserSql, getDataSource, getDBInfo, getDefaultSchemaName, getDeleteAuthoritiesSql, getDeleteUserSql, getJChemPropertyTableNames, getJdbcTemplate, getLobHandler, getMetaTableNames, getSchemaNames, getSetEnabledSql, getTableNames, getTransactionManager, getUpdatePasswordSql, getUsedSchemas, getViewNames, readValue, sqlAddColumn, sqlAddForeignKey, sqlAddIndex, sqlAddUniqueConstraint, sqlAlterColumnRequired, sqlCreateSecurityTables, sqlCreateSecurityTablesExternalConstraints, sqlCreateSequence, sqlDeleteRow, sqlDropForeignKey, sqlDropIndex, sqlDropPrimaryConstraint, sqlDropSequence, sqlDropTable, sqlDropUniqueConstraint, sqlFullColumnDefinition, sqlInsertRow, sqlInsertRowDefaults, sqlNow, sqlRebuildIndex, sqlSelectDuplicateRows, sqlUpdateIJCViewsTable, sqlUpdateRow, sqlUpgradeCommand, translateSQLException, updateHeartbeat
-
-
-
-
Field Detail
-
IJC_SCHEMA_TABLE_NAME
static final java.lang.String IJC_SCHEMA_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_ITEM_INFO_TABLE_NAME
static final java.lang.String IJC_ITEM_INFO_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_VIEWS_TABLE_NAME
@Deprecated static final java.lang.String IJC_VIEWS_TABLE_NAME
Deprecated.Since 5.12, this table is an empty stub for older versions, which try to create the tables just after connecting to the database. During the upgrade, the data should have been copied to IJC_CUSTOM_ITEMS. In addition, the original IJC_VIEWS was renamed to IJC_VIEWS_BACKUP.- See Also:
- Constant Field Values
-
IJC_USER_TABLE_NAME
static final java.lang.String IJC_USER_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_ITEM_USER_TABLE_NAME
static final java.lang.String IJC_ITEM_USER_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_VIEWS_SEQUENCE_NAME
static final java.lang.String IJC_VIEWS_SEQUENCE_NAME
- See Also:
- Constant Field Values
-
IJC_SECURITY_USERS_TABLE_NAME
static final java.lang.String IJC_SECURITY_USERS_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_SECURITY_AUTHORITIES_TABLE_NAME
static final java.lang.String IJC_SECURITY_AUTHORITIES_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_SECURITY_INFO_TABLE_NAME
static final java.lang.String IJC_SECURITY_INFO_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_INVOCATION_LOG_TABLE_NAME
static final java.lang.String IJC_INVOCATION_LOG_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_CHANGE_LOG_TABLE_NAME
static final java.lang.String IJC_CHANGE_LOG_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_AUTHORITIES_TABLE_NAME
static final java.lang.String IJC_AUTHORITIES_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_SCHEMA_AUTHORITIES_TABLE_NAME
static final java.lang.String IJC_SCHEMA_AUTHORITIES_TABLE_NAME
- See Also:
- Constant Field Values
-
IJC_VIEWS_BACKUP_TABLE_NAME
static final java.lang.String IJC_VIEWS_BACKUP_TABLE_NAME
Renamed IJC_VIEWS. This table is present only in schema which underwent upgrade from 5.8 to 5.12.- See Also:
- Constant Field Values
-
-
Method Detail
-
createIdColumnNameFromTableName
java.lang.String createIdColumnNameFromTableName(java.lang.String tableName)
-
getCartridgeOwner
java.lang.String getCartridgeOwner()
Get the user that owns the JChem cartridge functions. Will return null if the database is not Oracle or the cartridge is not installed and appropriate grants not made to the current user/schema.- Returns:
- db user or null
-
getCatalog
java.lang.String getCatalog()
-
getColumnListCommaSeparated
java.lang.String getColumnListCommaSeparated(java.lang.String[] columns)
- Parameters:
columns
-- Returns:
- The comma-separated list of column names
-
getMetaTableNamesSorted
java.util.List<java.lang.String> getMetaTableNamesSorted()
-
sqlAlterColumnDefault
java.lang.String sqlAlterColumnDefault(SchemaQualifiedName tableName, java.lang.String columnName, java.lang.Class colClass, java.lang.String nativeType, java.lang.String columnDefinition, java.lang.String defaultValue, boolean required)
-
sqlAlterColumnDefault
java.lang.String sqlAlterColumnDefault(java.lang.String tableName, java.lang.String columnName, java.lang.String nativeType, java.lang.String columnDefinition, java.lang.String defaultValue, boolean required)
-
sqlAlterColumnName
java.lang.String sqlAlterColumnName(java.lang.String tableName, java.lang.String oldName, java.lang.String newName, java.lang.String definition)
-
sqlAlterColumnSize
java.lang.String sqlAlterColumnSize(java.lang.String tableName, java.lang.String columnName, java.lang.String columnDefinition)
-
sqlAlterTableName
java.lang.String sqlAlterTableName(java.lang.String oldName, java.lang.String newName)
-
sqlCreateIJCViewsTable
@Deprecated java.lang.String sqlCreateIJCViewsTable()
Deprecated.Use IJC_CUSTOM_ITEMS. This method remains for tests.- Returns:
-
sqlCreateFakeIJCViewsTable
java.lang.String sqlCreateFakeIJCViewsTable()
During upgrade to 5.12, the IJC_VIEWS was renamed to IJC_VIEWS_BACKUP. When old IJC tries to connect, it creates IJC_VIEWS before checking whether it should perform an upgrade. It fails on existing constraint names.The workaround is to create empty IJC_VIEWS table, unusable by the old IJC, which would prevent the creation.
- Returns:
- sql for fake IJC_VIEWS
-
sqlCreateIJCGenericsTable
@Deprecated java.lang.String sqlCreateIJCGenericsTable()
Deprecated.
-
sqlCreateIJCGenericsTableV512
java.lang.String sqlCreateIJCGenericsTableV512()
- Returns:
- SQL for creating IJC_CUSTOM_ITEMS with PK not on SCHEMA, PARENT, ID, but only on SCHEMA, ID
-
sqlCreateIJCGenericsSharingTable
java.lang.String sqlCreateIJCGenericsSharingTable()
-
sqlCreateIJCConnectStructureMappingTable
java.lang.String sqlCreateIJCConnectStructureMappingTable()
-
sqlCreateIJCConnectCustomItemsTable
java.lang.String[] sqlCreateIJCConnectCustomItemsTable()
-
sqlCreateIJCApiKeysTable
java.lang.String sqlCreateIJCApiKeysTable()
-
sqlCreateIJCItemInfoTable
java.lang.String sqlCreateIJCItemInfoTable()
-
sqlCreateIJCItemUserTable
java.lang.String sqlCreateIJCItemUserTable()
-
sqlCreateIJCInvocationLogTable
java.lang.String[] sqlCreateIJCInvocationLogTable()
-
sqlCreateIJCChangesLogTable
java.lang.String[] sqlCreateIJCChangesLogTable()
-
sqlCreateIJCAuthoritiesTable
java.lang.String sqlCreateIJCAuthoritiesTable()
-
sqlCreateIJCSchemaAuthoritiesTable
java.lang.String sqlCreateIJCSchemaAuthoritiesTable()
-
sqlCreateIJCSecurityAuthoritiesAuthoritiesFK
java.lang.String sqlCreateIJCSecurityAuthoritiesAuthoritiesFK()
-
sqlCreateIJCSchemaTable
java.lang.String sqlCreateIJCSchemaTable()
-
sqlCreateIJCSecurityInfoTable
java.lang.String sqlCreateIJCSecurityInfoTable()
-
sqlCreateIJCUserTable
java.lang.String sqlCreateIJCUserTable()
-
sqlCreateTable
java.lang.String sqlCreateTable(java.lang.String tableName, java.lang.String idColumnName, java.lang.String extraCols)
-
sqlCreateTable
java.lang.String sqlCreateTable(java.lang.String schemaPlusTable, java.util.List<DBDatabaseInfo.NativeType> columnDefs, java.util.List<java.lang.String> columnNames)
Description copied from interface:DatabasePlatform
Creates a table with the given name and the fields. The list of columnDefs cannot be empty or null; the table must contain at least one column. The list of column names must be the same size as column definitions; name at index "i" will be used for column defined by definition at index "i".- Specified by:
sqlCreateTable
in interfaceDatabasePlatform
- Parameters:
schemaPlusTable
- identifier of the tablecolumnDefs
- The column definitionscolumnNames
- The column names- Returns:
- SQL statement to create the table
-
sqlCreateView
java.lang.String sqlCreateView(java.lang.String viewName, java.lang.String sql)
-
sqlDropColumn
java.lang.String sqlDropColumn(java.lang.String tableName, java.lang.String columnName)
-
sqlDropView
java.lang.String sqlDropView(java.lang.String viewName)
-
sqlGenericItemInsertV511
@Deprecated java.lang.String sqlGenericItemInsertV511()
Deprecated.
-
sqlGetDBSchemaVersion
java.lang.String sqlGetDBSchemaVersion()
-
sqlRetrieveSequence
java.lang.String sqlRetrieveSequence(java.lang.String sequenceName)
-
sqlViewMetaDataInsert
@Deprecated java.lang.String sqlViewMetaDataInsert()
Deprecated.Use IJC_CUSTOM_ITEMS. This method remains for tests.- Returns:
-
sqlSchemaMetaDataInsert
java.lang.String sqlSchemaMetaDataInsert()
-
sqlSchemaMetaDataNextIndex
java.lang.String sqlSchemaMetaDataNextIndex()
-
sqlSetDBSchemaVersion
java.lang.String sqlSetDBSchemaVersion(boolean insert)
-
sqlSelectFromIjcSchema
java.lang.String sqlSelectFromIjcSchema()
-
sqlSelectFromIjcSchemaByType
java.lang.String sqlSelectFromIjcSchemaByType()
-
sqlSelectFromIjcCustomItems
java.lang.String sqlSelectFromIjcCustomItems()
-
sqlSelectFromIjcItemInfo
java.lang.String sqlSelectFromIjcItemInfo()
-
sqlSelectFromIjcSecurityInfo
java.lang.String sqlSelectFromIjcSecurityInfo()
-
sqlSelectFromIjcItemUserByUser
java.lang.String sqlSelectFromIjcItemUserByUser()
-
sqlSelectFromIjcItemUser
java.lang.String sqlSelectFromIjcItemUser()
-
sqlSelectFromIjcAuthorities
java.lang.String sqlSelectFromIjcAuthorities()
-
sqlDataColumn
java.lang.String sqlDataColumn()
-
getInClause
java.lang.String getInClause(int numItems)
-
sqlDeleteSharing
java.lang.String sqlDeleteSharing()
- Returns:
- Approx. the following:
DELETE FROM ijc_custom_items_sharing WHERE schema_id = ? AND custom_item_id = ?
-
sqlInsertSharing
java.lang.String sqlInsertSharing()
- Returns:
- Approx. the following:
INSERT INTO ijc_custom_items_sharing (schema_id, custom_items_id, authority, priv) VALUES (?, ?, ?, ?)
-
sqlQueryForCustomItemSharing
java.lang.String sqlQueryForCustomItemSharing()
- Returns:
- Approx. the following:
SELECT authority, priv FROM ijc_custom_items_sharing WHERE schema_id = ? AND custom_item_id = ?
-
sqlUpdatePasswordColumn
java.lang.String sqlUpdatePasswordColumn(int size)
- Parameters:
size
- the new size of the column- Returns:
- the sql statement for updating the password column in ijc_security_users table
-
-