|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DatabasePlatform
| Field Summary | |
|---|---|
static String |
IJC_SCHEMA_OTHER_TABLE_NAME
|
static String |
NAME_PRIMARY_KEY_CONSTRAINT
Marker for a constraint that enforces the primary key. |
| Method Summary | |
|---|---|
DBColInfo |
buildColumnInfoForColumn(String dbSchemaName,
String tableName,
String columnName)
Build the DBColInfos for the particlaar column. |
List<DBColInfo> |
buildColumnInfosForTable(String dbSchemaName,
String tableName)
Build the DBColInfos for the table. |
List<DBConstraintInfo> |
buildConstraintInfosForTable(String dbSchemaName,
String tableName,
List<DBColInfo> cols)
Retrieves unique constraints declared for the table. |
List<DBForeignKeyInfo> |
buildExportedForeignKeyInfoForTable(String schemaName,
String tableName)
Build exported foreign key info |
List<DBForeignKeyInfo> |
buildImportedForeignKeyInfoForTable(String schemaName,
String tableName)
Build imported foreign key info |
List<DBIndexInfo> |
buildIndexInfoForTable(String schemaName,
String tableName)
Build index info for the specified table |
Set<String> |
buildJChemPropertyTableNames()
|
List<DBSequenceInfo> |
buildSequenceInfo(String schema)
|
DBSequenceInfo |
buildSequenceInfo(String schema,
String seqName)
|
DBTableInfo |
buildTableInfo(String schema,
String table,
LazyLoader lazyLoader,
DFFeedback feedback)
Build the full table info for this table. |
DBTableInfo |
buildTableInfoFull(String schema,
String table,
LazyLoader lazyLoader,
DFFeedback feedback)
|
Map<String,DBTableInfo> |
buildTableInfos(String schema,
List<String> tablesToInit,
LazyLoader lazyLoader,
DFFeedback feedback)
Build all table infos for the specified schema |
Map<String,DBTableInfo> |
buildTableInfosEager(String schema,
DFFeedback feedback)
|
Map<String,DBTableInfo> |
buildTableInfosLazy(String schema,
LazyLoader lazyLoader,
DFFeedback feedback)
|
void |
checkSchemaExistence(String schemaId)
Checks whether an schema exists in the IJC metadata registry (IJC_SCHEMA table) or not also checks whether the database/ IJC_SCHEMA table exists or not. |
void |
executeDDL(String[] sql,
boolean log)
Execute these DDL statements |
void |
executeDDL(String sql,
boolean log)
Execute this DDL statement |
String |
getAddAuthoritySql()
|
String |
getAddUserSql()
|
DataSource |
getDataSource()
|
DBDatabaseInfo |
getDBInfo()
|
String |
getDefaultSchemaName()
|
String |
getDeleteAuthoritiesSql()
|
String |
getDeleteUserSql()
|
JdbcTemplate |
getJdbcTemplate()
|
LobHandler |
getLobHandler()
|
Set<String> |
getMetaTableNames()
|
List<String> |
getSchemaNames()
Get the list of schema names that are accessible to the user. |
String |
getSetEnabledSql()
|
String[] |
getTableNames(String schema)
Get the table names for the specified schema |
DataSourceTransactionManager |
getTransactionManager()
|
String |
getUpdatePasswordSql()
|
List<String> |
getUsedSchemas()
Get used schema by IJC schema |
String[] |
getViewNames(String schema)
Get the view names for the specified schema |
boolean |
isProjectDatabase()
|
Object |
readValue(ResultSet rs,
String columnName,
Class columnClass,
int jdbcType)
Deprecated. Use the DBValueHandler which is available from the DBFieldCapability instead. |
void |
shutdown()
Default is to do nothing. |
String |
sqlAddColumn(String schemaPlusTable,
String colName,
String colClass,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
|
String |
sqlAddForeignKey(String fkName,
String parentSchemaPlusTable,
String dependentSchemaPlusTable,
String[] parentCols,
String[] dependentCols,
String onDeleteRule,
String onUpdateRule)
|
String |
sqlAddIndex(String indexName,
String indexType,
String schemaPlusTable,
String[] columns,
boolean[] asc)
Add an index to the table |
String |
sqlAddUniqueConstraint(String consName,
String schemaPlusTable,
String[] columns)
Add unique constraint for some columns in the table. |
String |
sqlAlterColumnRequired(String schemaPlusTable,
String columnName,
String nativeType,
String columnDefinition,
String defaultValue,
boolean required)
|
String |
sqlCount(SchemaQualifiedName schemaPlusTable)
|
String[] |
sqlCreateSecurityTables()
Get the SQL need3ed to create the username/password tables. |
String[] |
sqlCreateSecurityTablesExternalConstraints()
Constraints from the security tables to the other tables. |
String |
sqlCreateSequence(String schemaPlusSequenceName)
|
String |
sqlCreateTable(String schemaPlusTable,
List<DBDatabaseInfo.NativeType> columnDefs,
List<String> columnNames)
Creates a table with the given name and the fields. |
String |
sqlDeleteRow(String schemaPlusTable,
String whereClause)
Generate SQL to delete a row. |
String |
sqlDropForeignKey(String schemaPlusTable,
String fkName)
|
String |
sqlDropIndex(String schemaPlusTable,
String indexName)
|
String |
sqlDropPrimaryConstraint(String schemaPlusTable,
String consName,
String[] columns)
|
String |
sqlDropSequence(String schemaPlusSequenceName)
|
String |
sqlDropTable(String schemaPlusTable)
|
String |
sqlDropUniqueConstraint(String schemaPlusTable,
String consName,
String[] columns)
|
String |
sqlFullColumnDefinition(String colClass,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
Generate the full column definition, including the defintion of any default value and the NULL/NOT NULL. |
String |
sqlInsertRow(SchemaQualifiedName schemaPlusTable,
List columnNames)
Creates insert row sql for a prepared statement of the form INSERT INTO table_name (col_1, col_2...) VALUES (?,?...) |
String |
sqlInsertRowDefaults(SchemaQualifiedName schemaPlusTable,
String[] idColumnNames)
Creates insert row sql that inserts the default value for these columns. |
String |
sqlLastId(SchemaQualifiedName schemaPlusTable)
|
String |
sqlNow()
get the appropriate SQL clause for the curent time. |
String |
sqlRebuildIndex(String schemaPlusTable,
String indexName)
|
String |
sqlSelectDistinct(SchemaQualifiedName schemaPlusTable,
String[] columnNames)
|
String |
sqlSelectDuplicateRows(String schemaPlusTable,
String[] columns)
|
SQLSelectStatement |
sqlSelectInList(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String inClauseColName,
DBDatabaseInfo.ColumnSQLType inClauseColType,
Collection ids)
|
SQLSelectStatement |
sqlSelectPS(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String idCol)
Creates SQL for a select statement that uses a PreparedStatement. |
String[] |
sqlUpdateIJCViewsTable()
|
String |
sqlUpdateRow(SchemaQualifiedName schemaPlusTable,
String updateClause,
String whereClause)
|
String |
sqlUpgradeCommand(String version,
String key)
|
void |
start()
Starts the platform by connecting to the database. |
DataAccessException |
translateSQLException(String message,
String sql,
SQLException ex)
|
void |
updateHeartbeat(String userName,
String schemaId)
Updates when the last time user accessed the database for purpose of changing the data |
| Field Detail |
|---|
static final String IJC_SCHEMA_OTHER_TABLE_NAME
static final String NAME_PRIMARY_KEY_CONSTRAINT
| Method Detail |
|---|
DataSource getDataSource()
DataSourceTransactionManager getTransactionManager()
JdbcTemplate getJdbcTemplate()
DBDatabaseInfo getDBInfo()
Set<String> buildJChemPropertyTableNames()
String getDefaultSchemaName()
DBTableInfo buildTableInfo(String schema,
String table,
LazyLoader lazyLoader,
DFFeedback feedback)
schema - The schema in which the table residestable - The table name
DBTableInfo buildTableInfoFull(String schema,
String table,
LazyLoader lazyLoader,
DFFeedback feedback)
Map<String,DBTableInfo> buildTableInfos(String schema,
List<String> tablesToInit,
LazyLoader lazyLoader,
DFFeedback feedback)
schema -
Map<String,DBTableInfo> buildTableInfosLazy(String schema,
LazyLoader lazyLoader,
DFFeedback feedback)
Map<String,DBTableInfo> buildTableInfosEager(String schema,
DFFeedback feedback)
List<DBColInfo> buildColumnInfosForTable(String dbSchemaName,
String tableName)
dbSchemaName - The schema nametableName - The table name
DBColInfo buildColumnInfoForColumn(String dbSchemaName,
String tableName,
String columnName)
dbSchemaName - The schema nametableName - The table namecolumnName - The column name to match
List<DBIndexInfo> buildIndexInfoForTable(String schemaName,
String tableName)
schemaName - The schema nametableName - The table name
List<DBForeignKeyInfo> buildExportedForeignKeyInfoForTable(String schemaName,
String tableName)
schemaName - The schema nametableName - The table name
List<DBForeignKeyInfo> buildImportedForeignKeyInfoForTable(String schemaName,
String tableName)
schemaName - The schema nametableName - The table name
LobHandler getLobHandler()
@Deprecated
Object readValue(ResultSet rs,
String columnName,
Class columnClass,
int jdbcType)
throws SQLException
SQLException
String sqlFullColumnDefinition(String colClass,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
colClass - nativeType - columnDefinition - defaultValue - isNotNull -
List<DBSequenceInfo> buildSequenceInfo(String schema)
DBSequenceInfo buildSequenceInfo(String schema,
String seqName)
seqName -
String sqlCreateSequence(String schemaPlusSequenceName)
String sqlDropSequence(String schemaPlusSequenceName)
String sqlAddColumn(String schemaPlusTable,
String colName,
String colClass,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
String sqlUpgradeCommand(String version,
String key)
String sqlSelectDuplicateRows(String schemaPlusTable,
String[] columns)
String sqlDeleteRow(String schemaPlusTable,
String whereClause)
schemaPlusTable - The schema and name of the table to delete fromwhereClause - The "WHERE" part of the SQL delete command.
String sqlInsertRow(SchemaQualifiedName schemaPlusTable,
List columnNames)
schemaPlusTable - The schema and name of the tablecolumnNames - The names of the columns with data
String sqlAlterColumnRequired(String schemaPlusTable,
String columnName,
String nativeType,
String columnDefinition,
String defaultValue,
boolean required)
String sqlNow()
List<String> getSchemaNames()
List<String> getUsedSchemas()
String[] getTableNames(String schema)
schema - The schema to look in. Should be null if the database does not support schemas
String sqlDropTable(String schemaPlusTable)
void executeDDL(String[] sql,
boolean log)
sql - Array of SQL statementslog - Whether to log by default. Note that the user preference might overrride this.
void executeDDL(String sql,
boolean log)
sql - A SQL statementlog - Whether to log by default. Note that the user preference might overrride this.String[] sqlCreateSecurityTables()
String[] sqlCreateSecurityTablesExternalConstraints()
String getAddUserSql()
String getAddAuthoritySql()
String getUpdatePasswordSql()
String getSetEnabledSql()
String getDeleteUserSql()
String getDeleteAuthoritiesSql()
String sqlInsertRowDefaults(SchemaQualifiedName schemaPlusTable,
String[] idColumnNames)
schemaPlusTable - The name of the tableidColumnNames - The names of the columns to insert the default
SQLSelectStatement sqlSelectInList(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String inClauseColName,
DBDatabaseInfo.ColumnSQLType inClauseColType,
Collection ids)
schemaPlusTable - selectElements - Set of elements to selectinClauseColName - inClauseColType -
SQLSelectStatement sqlSelectPS(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String idCol)
schemaPlusTable - The tableselectElements - The elelement that the statement shoudl selectidCol - The column to use for the bound variable in the where clauseString sqlLastId(SchemaQualifiedName schemaPlusTable)
String sqlSelectDistinct(SchemaQualifiedName schemaPlusTable,
String[] columnNames)
String sqlUpdateRow(SchemaQualifiedName schemaPlusTable,
String updateClause,
String whereClause)
schemaPlusTable - The name of the table to updateupdateClause - The values to update e.g. col1 = 'hello world', col2 = 77whereClause - The where clause to defined the row(s) e.g. id = 999
String sqlCount(SchemaQualifiedName schemaPlusTable)
String sqlAddUniqueConstraint(String consName,
String schemaPlusTable,
String[] columns)
consName - The c onstraint nameschemaPlusTable - The t able namecolumns - The c olumns which will form the unique key. Order is important.
String sqlDropPrimaryConstraint(String schemaPlusTable,
String consName,
String[] columns)
String sqlDropUniqueConstraint(String schemaPlusTable,
String consName,
String[] columns)
Set<String> getMetaTableNames()
void shutdown()
String sqlAddForeignKey(String fkName,
String parentSchemaPlusTable,
String dependentSchemaPlusTable,
String[] parentCols,
String[] dependentCols,
String onDeleteRule,
String onUpdateRule)
String sqlCreateTable(String schemaPlusTable,
List<DBDatabaseInfo.NativeType> columnDefs,
List<String> columnNames)
schemaPlusTable - columnDefs - The column definitionscolumnNames - The column names
List<DBConstraintInfo> buildConstraintInfosForTable(String dbSchemaName,
String tableName,
List<DBColInfo> cols)
dbSchemaName - The schema and name of the tabletableName - The n ame of the tablecols - The columns in the table to look in
String sqlDropForeignKey(String schemaPlusTable,
String fkName)
String[] getViewNames(String schema)
schema - The schema to look in. Should be null if the database does not support schemas
DataAccessException translateSQLException(String message,
String sql,
SQLException ex)
String sqlRebuildIndex(String schemaPlusTable,
String indexName)
String sqlDropIndex(String schemaPlusTable,
String indexName)
String sqlAddIndex(String indexName,
String indexType,
String schemaPlusTable,
String[] columns,
boolean[] asc)
indexName - The name for the index.indexType - The type of index. e.g. UNIQUE. Consult the supportedIndexTypes()
method to find out which types your DB supports. Can be null for a regular index.schemaPlusTable - The table for the indexcolumns - The columnsasc - Is the index for this column ascending or descending. true means ASC, false means DESC.
Can be null, but if specified must have the same size as the columns
Must be the same number of values as there are columns.
boolean isProjectDatabase()
void start()
throws InitializationException
InitializationExceptionString[] sqlUpdateIJCViewsTable()
void checkSchemaExistence(String schemaId)
throws SchemaDoesNotExistException
schemaId -
SchemaDoesNotExistException
void updateHeartbeat(String userName,
String schemaId)
userName - current logged in useschemaId - current schema
|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||