|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.jdbc.core.support.JdbcDaoSupport
com.im.commons.db.AbstractDatabasePlatform
public abstract class AbstractDatabasePlatform
Provides information for interacting with a database.
This information includes:
To support a new database subclass this to provide the appropriate information for your database.
This class also makes available an instance of DBDatabaseInfo
which is provides static information about the database that can be used for information
that does not need the database to be queries each time.
DBDatabaseInfo| Field Summary |
|---|
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Fields inherited from interface com.im.commons.db.DatabasePlatform |
|---|
IJC_SCHEMA_OTHER_TABLE_NAME, NAME_PRIMARY_KEY_CONSTRAINT |
| Constructor Summary | |
|---|---|
protected |
AbstractDatabasePlatform(BaseDataSource dds)
|
| Method Summary | |
|---|---|
void |
addPseudoColumnInfos(List<DBColInfo> cols,
String columnPattern)
Add any magical pseudo columns such as Oracle's ROWID columns |
DBColInfo |
buildColumnInfoForColumn(String dbSchemaName,
String tableName,
String columnName)
Build the DBColInfos for the particlaar column. |
Map<String,List<DBColInfo>> |
buildColumnInfosForSchema(String dbSchemaName)
|
List<DBColInfo> |
buildColumnInfosForTable(String dbSchemaName,
String tableName)
Build the DBColInfos for the table. |
protected Map<String,List<DBConstraintInfo>> |
buildConstraintInfosForSchema(String dbSchemaName)
Build constraint info for the specified schema. |
protected List<DBConstraintInfo> |
buildConstraintInfosImpl(String dbSchemaName,
String tableName,
List<DBColInfo> collsInTable)
Build constraint info for the specified table. |
List<DBForeignKeyInfo> |
buildExportedForeignKeyInfoForTable(String dbSchemaName,
String tableName)
Build exported foreign key info |
List<DBForeignKeyInfo> |
buildImportedForeignKeyInfoForTable(String dbSchemaName,
String tableName)
Build imported foreign key info |
List<DBIndexInfo> |
buildIndexInfoForTable(String schemaName,
String tableName)
Build index info for the specified table |
protected CaseInsensitiveMap<List<DBIndexInfo>> |
buildIndexInfoImpl(String schemaName,
String tableName)
|
protected Map<String,List<DBIndexInfo>> |
buildIndexInfosForSchema(String schemaName)
|
Set<String> |
buildJChemPropertyTableNames()
Build the known JChem property table names. |
List<DBSequenceInfo> |
buildSequenceInfo(String schema)
Default implementation assumes sequences are not supported and returns an empty list |
DBSequenceInfo |
buildSequenceInfo(String schema,
String seqName)
Default implementation assumes sequences are not supported and returns null |
DBTableInfo |
buildTableInfo(String dbSchemaName,
String tableName,
LazyLoader lazyLoader,
DFFeedback feedback)
Build the full table info for this table. |
DBTableInfo |
buildTableInfoFull(String dbSchemaName,
String tableName,
LazyLoader lazyLoader,
DFFeedback feedback)
|
Map<String,DBTableInfo> |
buildTableInfos(String dbSchemaName,
List<String> tablesToInit,
LazyLoader lazyLoader,
DFFeedback feedback)
Build all table infos for the specified schema |
Map<String,DBTableInfo> |
buildTableInfosEager(String dbSchemaName,
DFFeedback feedback)
|
Map<String,DBTableInfo> |
buildTableInfosLazy(String dbSchemaName,
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. |
static DatabasePlatform |
create(BaseDataSource dds)
|
static DatabasePlatform |
create(BaseDataSource dds,
boolean init)
Create method with extra init param that can be used from unit tests. |
static DatabasePlatform |
create(String driver,
String url,
String user,
String password,
String schema,
String catalog,
Properties properties,
boolean init)
|
protected DBDatabaseInfo |
createDatabaseInfo(Properties sqlTemplates)
|
protected abstract DBDatabaseInfo |
createDatabaseInfo(Properties sqlTemplates,
String dbIdentifierQuoteString,
String cartOwner,
String cartridgeEnvironment)
|
static DatabasePlatform |
createFromDataSource(BaseDataSource dds)
|
String |
createIdColumnNameFromTableName(String tableName)
|
protected LobHandler |
createLobHandler()
|
protected NativeJdbcExtractor |
createNativeJdbcExtractor()
|
protected Map<String,List<DBColInfo>> |
doBuildColumnInfosImpl(Connection con,
String dbSchemaName,
String tableName,
String columnName)
|
protected Map<String,List<DBColInfo>> |
doBuildColumnInfosImpl(String dbSchemaName,
String tableName,
String columnName)
|
protected boolean |
excludeTableFromTableNames(String table)
|
protected boolean |
excludeTableFromViewNames(String table)
|
void |
executeDDL(String[] sql,
boolean log)
Execute these DDL statements |
void |
executeDDL(String sql,
boolean log)
Execute this DDL statement |
protected String |
fetchIdentifierQuoteString()
|
protected Set<String> |
findJChemPropertyTables()
|
protected String[] |
findPrimaryKeyColumnNames(DatabaseMetaData meta,
String schema,
String table)
|
String |
getAddAuthoritySql()
|
String |
getAddUserSql()
|
String |
getCallType()
|
String |
getCartridgeOwner()
Get the user that owns the JChem cartridge functions. |
String |
getCatalog()
|
String |
getColumnListCommaSeparated(String[] columns)
|
protected abstract Properties |
getCustomSqlTemplates()
|
DBDatabaseInfo |
getDBInfo()
|
String |
getDefaultSchemaName()
|
String |
getDeleteAuthoritiesSql()
|
String |
getDeleteUserSql()
|
LobHandler |
getLobHandler()
|
Set<String> |
getMetaTableNames()
|
List<String> |
getMetaTableNamesSorted()
|
NativeJdbcExtractor |
getNativeJdbcExtractor()
|
List<String> |
getSchemaNames()
Get the list of schema names that are accessible to the user. |
String |
getSetEnabledSql()
|
protected Properties |
getSqlTemplates()
The templates with which to generate SQL statements appropriate for your database type. |
String[] |
getTableNames(String schema)
Get the table names for the specified schema |
TermEncoder |
getTermEncoder()
|
DataSourceTransactionManager |
getTransactionManager()
|
String |
getUpdatePasswordSql()
|
List<String> |
getUsedSchemas()
only used on sequences, please do not use this method |
String[] |
getViewNames(String schema)
Get the view names for the specified schema |
protected void |
initCatalogFromConnection()
|
protected void |
initDao()
|
boolean |
isProjectDatabase()
|
protected Properties |
loadPropertiesFromResource(String resource)
|
protected void |
preInitValidate()
|
protected abstract void |
readPropertyTables(Set<String> tables,
ResultSet rs)
|
protected void |
readPropertyTablesNoSchema(Set<String> tables,
ResultSet rs)
|
protected void |
readPropertyTablesWithSchema(Set<String> tables,
ResultSet rs)
|
Object |
readValue(ResultSet rs,
String columnName,
Class columnClass,
int jdbcType)
Read the value from the ResultSet. |
void |
setCallType(String callType)
|
void |
setUsedSchemas(List<String> usedSchemas)
|
void |
shutdown()
Default is to do nothing. |
protected void |
specifyCartridgePassword(String cartOwner)
|
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 |
sqlAlterColumnName(String schemaPlusTable,
String oldName,
String newName,
String definition)
|
String |
sqlAlterColumnSize(String schemaPlusTable,
String columnName,
String columnDefinition)
|
String |
sqlAlterTableName(String oldSchemaPlusTable,
String newSchemaPlusTable)
|
String |
sqlCount(SchemaQualifiedName schemaPlusTable)
|
String |
sqlCreateIJCAuthoritiesTable()
|
String[] |
sqlCreateIJCChangesLogTable()
|
String |
sqlCreateIJCGenericsTable()
|
String[] |
sqlCreateIJCInvocationLogTable()
|
String |
sqlCreateIJCItemInfoTable()
|
String |
sqlCreateIJCItemUserTable()
|
String |
sqlCreateIJCSchemaAuthoritiesTable()
|
String |
sqlCreateIJCSchemaTable()
|
String |
sqlCreateIJCSecurityAuthoritiesAuthoritiesFK()
|
String |
sqlCreateIJCSecurityInfoTable()
|
String |
sqlCreateIJCUserTable()
|
String[] |
sqlCreateIJCViewsTable()
|
String[] |
sqlCreateSecurityTables()
Get the SQL that creates the database-based security 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 |
sqlCreateTable(String schemaPlusTable,
String idColumnName,
String extraCols)
|
String |
sqlCreateView(String schemaPlusView,
String sql)
|
String |
sqlDeleteRow(String schemaPlusTable,
String whereClause)
Generate SQL to delete a row. |
String |
sqlDropColumn(String schemaPlusTable,
String columnName)
|
protected String |
sqlDropConstraint(String schemaPlusTable,
String constraintName)
|
String |
sqlDropForeignKey(String schemaPlusTable,
String fkName)
|
String |
sqlDropIndex(String schemaPlusTable,
String indexName)
|
String |
sqlDropPrimaryConstraint(String schemaPlusTable,
String consName,
String[] columns)
|
String |
sqlDropSequence(String schemaPlusSequence)
|
String |
sqlDropTable(String schemaPlusTable)
|
String |
sqlDropUniqueConstraint(String schemaPlusTable,
String consName,
String[] columns)
|
String |
sqlDropView(String schemaPlusView)
|
String |
sqlFullColumnDefinition(String colClassName,
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 |
sqlGenericItemDelete()
|
String |
sqlGenericItemInsert()
|
String |
sqlGenericItemUpdate()
|
String |
sqlGetDBSchemaVersion()
|
String |
sqlGetItemsByType()
|
protected String |
sqlGetTablesWithPropertyColumns()
|
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. |
protected String |
sqlJChemCartridgeEnvironment()
|
protected String |
sqlJChemCartridgeOwner()
|
String |
sqlLastId(SchemaQualifiedName schemaPlusTable)
|
String |
sqlQueryForIds(String schemaPlusTable,
String[] idColumnNames,
int limit)
|
String |
sqlQueryForIdsWithSort(String schemaPlusTable,
String[] idColumnNames,
int limit,
SortColumn[] sortCols)
|
String |
sqlRetrieveSequence(String schemPlusSequence)
|
String |
sqlSchemaMetaDataInsert()
|
String |
sqlSchemaMetaDataNextIndex()
|
String |
sqlSelect(String schemaPlusTable,
String columns,
String idColumnName)
|
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 |
sqlSetDBSchemaVersion(boolean insert)
|
String |
sqlSort(List ids,
SortColumn[] sortCols,
SchemaQualifiedName schemaPlusTable,
String selectCol,
DBDatabaseInfo.ColumnSQLType selectColType)
|
String[] |
sqlUpdateIJCViewsTable()
|
String |
sqlUpdateRow(SchemaQualifiedName schemaPlusTable,
String updateClause,
String whereClause)
|
String |
sqlUpgradeCommand(String version,
String key)
|
String |
sqlViewMetaDataInsert()
|
String |
sqlViewMetaDataNextIndex()
|
void |
start()
Starts the platform by connecting to the database. |
static boolean |
stringArrayContains(String[] hayStack,
String needle)
|
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 |
| Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport |
|---|
checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplate |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.im.commons.db.DatabasePlatformX |
|---|
sqlAlterColumnDefault, sqlAlterColumnDefault |
| Methods inherited from interface com.im.commons.db.DatabasePlatform |
|---|
buildConstraintInfosForTable, getDataSource, getJdbcTemplate, sqlAlterColumnRequired, sqlNow, sqlRebuildIndex |
| Constructor Detail |
|---|
protected AbstractDatabasePlatform(BaseDataSource dds)
| Method Detail |
|---|
protected String fetchIdentifierQuoteString()
public static DatabasePlatform create(String driver,
String url,
String user,
String password,
String schema,
String catalog,
Properties properties,
boolean init)
public static DatabasePlatform createFromDataSource(BaseDataSource dds)
public static DatabasePlatform create(BaseDataSource dds)
public static DatabasePlatform create(BaseDataSource dds,
boolean init)
dds - The BaseDataSourceinit - If true DAO is initialized
public final boolean isProjectDatabase()
isProjectDatabase in interface DatabasePlatformpublic Set<String> buildJChemPropertyTableNames()
buildJChemPropertyTableNames in interface DatabasePlatformpublic Set<String> getMetaTableNames()
getMetaTableNames in interface DatabasePlatformpublic List<String> getMetaTableNamesSorted()
getMetaTableNamesSorted in interface DatabasePlatformXpublic void shutdown()
shutdown in interface DatabasePlatformpublic DataSourceTransactionManager getTransactionManager()
getTransactionManager in interface DatabasePlatformpublic NativeJdbcExtractor getNativeJdbcExtractor()
getNativeJdbcExtractor in interface DatabasePlatformXprotected NativeJdbcExtractor createNativeJdbcExtractor()
public LobHandler getLobHandler()
getLobHandler in interface DatabasePlatformprotected LobHandler createLobHandler()
public String getDefaultSchemaName()
getDefaultSchemaName in interface DatabasePlatformpublic String getCatalog()
getCatalog in interface DatabasePlatformXprotected Properties getSqlTemplates()
public void start()
throws InitializationException
start in interface DatabasePlatformInitializationExceptionprotected void preInitValidate()
protected void initDao()
throws InitializationException
initDao in class DaoSupportInitializationException
protected void initCatalogFromConnection()
throws SQLException
SQLExceptionprotected DBDatabaseInfo createDatabaseInfo(Properties sqlTemplates)
protected void specifyCartridgePassword(String cartOwner)
protected abstract DBDatabaseInfo createDatabaseInfo(Properties sqlTemplates,
String dbIdentifierQuoteString,
String cartOwner,
String cartridgeEnvironment)
public DBDatabaseInfo getDBInfo()
getDBInfo in interface DatabasePlatform
protected abstract Properties getCustomSqlTemplates()
throws IOException
IOException
protected Properties loadPropertiesFromResource(String resource)
throws IOException
IOExceptionpublic String createIdColumnNameFromTableName(String tableName)
createIdColumnNameFromTableName in interface DatabasePlatformX
public String sqlCreateTable(String schemaPlusTable,
List<DBDatabaseInfo.NativeType> columnDefs,
List<String> columnNames)
sqlCreateTable in interface DatabasePlatformsqlCreateTable in interface DatabasePlatformXcolumnDefs - The column definitionscolumnNames - The column names
public List<String> getSchemaNames()
DatabasePlatform
getSchemaNames in interface DatabasePlatformpublic List<String> getUsedSchemas()
getUsedSchemas in interface DatabasePlatformpublic void setUsedSchemas(List<String> usedSchemas)
public String[] getTableNames(String schema)
DatabasePlatform
getTableNames in interface DatabasePlatformschema - The schema to look in. Should be null if the database does not support schemas
public String[] getViewNames(String schema)
DatabasePlatform
getViewNames in interface DatabasePlatformschema - The schema to look in. Should be null if the database does not support schemas
protected boolean excludeTableFromTableNames(String table)
protected boolean excludeTableFromViewNames(String table)
protected String[] findPrimaryKeyColumnNames(DatabaseMetaData meta,
String schema,
String table)
throws SQLException
SQLException
public void addPseudoColumnInfos(List<DBColInfo> cols,
String columnPattern)
cols - columnPattern - Pattern for the columns. Can be null, in which case all
pseudo columns are added. If a pattern is present then only pseudo columns
conforming to the pattern are added.
NOTE: columnPattern currently only supports a specific column name. Wildcards
are not supportedpublic Map<String,List<DBColInfo>> buildColumnInfosForSchema(String dbSchemaName)
public List<DBColInfo> buildColumnInfosForTable(String dbSchemaName,
String tableName)
DatabasePlatform
buildColumnInfosForTable in interface DatabasePlatformdbSchemaName - The schema nametableName - The table name
public DBColInfo buildColumnInfoForColumn(String dbSchemaName,
String tableName,
String columnName)
DatabasePlatform
buildColumnInfoForColumn in interface DatabasePlatformdbSchemaName - The schema nametableName - The table namecolumnName - The column name to match
protected Map<String,List<DBColInfo>> doBuildColumnInfosImpl(String dbSchemaName,
String tableName,
String columnName)
protected Map<String,List<DBColInfo>> doBuildColumnInfosImpl(Connection con,
String dbSchemaName,
String tableName,
String columnName)
throws SQLException
SQLExceptionpublic List<DBSequenceInfo> buildSequenceInfo(String schema)
buildSequenceInfo in interface DatabasePlatformschema -
public DBSequenceInfo buildSequenceInfo(String schema,
String seqName)
buildSequenceInfo in interface DatabasePlatformschema - seqName -
public List<DBForeignKeyInfo> buildImportedForeignKeyInfoForTable(String dbSchemaName,
String tableName)
DatabasePlatform
buildImportedForeignKeyInfoForTable in interface DatabasePlatformdbSchemaName - The schema nametableName - The table name
public List<DBForeignKeyInfo> buildExportedForeignKeyInfoForTable(String dbSchemaName,
String tableName)
DatabasePlatform
buildExportedForeignKeyInfoForTable in interface DatabasePlatformdbSchemaName - The schema nametableName - The table name
protected Map<String,List<DBIndexInfo>> buildIndexInfosForSchema(String schemaName)
public List<DBIndexInfo> buildIndexInfoForTable(String schemaName,
String tableName)
DatabasePlatform
buildIndexInfoForTable in interface DatabasePlatformschemaName - The schema nametableName - The table name
protected CaseInsensitiveMap<List<DBIndexInfo>> buildIndexInfoImpl(String schemaName,
String tableName)
public Object readValue(ResultSet rs,
String columnName,
Class columnClass,
int jdbcType)
throws SQLException
readValue in interface DatabasePlatformSQLException
public void executeDDL(String[] sql,
boolean log)
executeDDL in interface DatabasePlatformsql - Array of SQL statementslog - Whether to log by default. Note that the user preference might overrride this.
public void executeDDL(String sql,
boolean log)
executeDDL in interface DatabasePlatformsql - A SQL statementlog - Whether to log by default. Note that the user preference might overrride this.public String[] sqlUpdateIJCViewsTable()
sqlUpdateIJCViewsTable in interface DatabasePlatformpublic String[] sqlCreateSecurityTables()
sqlCreateSecurityTables in interface DatabasePlatformpublic String[] sqlCreateSecurityTablesExternalConstraints()
DatabasePlatform
sqlCreateSecurityTablesExternalConstraints in interface DatabasePlatformpublic String sqlGetItemsByType()
sqlGetItemsByType in interface DatabasePlatformXpublic String sqlGetDBSchemaVersion()
sqlGetDBSchemaVersion in interface DatabasePlatformXpublic String sqlSetDBSchemaVersion(boolean insert)
sqlSetDBSchemaVersion in interface DatabasePlatformX
public String sqlUpgradeCommand(String version,
String key)
sqlUpgradeCommand in interface DatabasePlatformpublic String sqlCreateIJCSchemaTable()
sqlCreateIJCSchemaTable in interface DatabasePlatformXpublic String sqlCreateIJCItemInfoTable()
sqlCreateIJCItemInfoTable in interface DatabasePlatformXpublic String[] sqlCreateIJCViewsTable()
sqlCreateIJCViewsTable in interface DatabasePlatformXpublic String sqlCreateIJCGenericsTable()
sqlCreateIJCGenericsTable in interface DatabasePlatformXpublic String sqlCreateIJCUserTable()
sqlCreateIJCUserTable in interface DatabasePlatformXpublic String sqlCreateIJCItemUserTable()
sqlCreateIJCItemUserTable in interface DatabasePlatformXpublic String sqlCreateIJCSecurityInfoTable()
sqlCreateIJCSecurityInfoTable in interface DatabasePlatformXpublic String[] sqlCreateIJCInvocationLogTable()
sqlCreateIJCInvocationLogTable in interface DatabasePlatformXpublic String[] sqlCreateIJCChangesLogTable()
sqlCreateIJCChangesLogTable in interface DatabasePlatformXpublic String sqlCreateIJCAuthoritiesTable()
sqlCreateIJCAuthoritiesTable in interface DatabasePlatformXpublic String sqlCreateIJCSchemaAuthoritiesTable()
sqlCreateIJCSchemaAuthoritiesTable in interface DatabasePlatformXpublic String sqlCreateIJCSecurityAuthoritiesAuthoritiesFK()
sqlCreateIJCSecurityAuthoritiesAuthoritiesFK in interface DatabasePlatformX
public String sqlCreateTable(String schemaPlusTable,
String idColumnName,
String extraCols)
sqlCreateTable in interface DatabasePlatformXpublic String sqlCreateSequence(String schemaPlusSequenceName)
sqlCreateSequence in interface DatabasePlatformpublic String sqlRetrieveSequence(String schemPlusSequence)
sqlRetrieveSequence in interface DatabasePlatformX
public String sqlUpdateRow(SchemaQualifiedName schemaPlusTable,
String updateClause,
String whereClause)
sqlUpdateRow in interface DatabasePlatformschemaPlusTable - The schema and name of the table to updateupdateClause - The values to update e.g. col1 = 'hello world', col2 = 77whereClause - The where clause to defeind the row(s) e.g. id = 999
public String sqlInsertRow(SchemaQualifiedName schemaPlusTable,
List columnNames)
sqlInsertRow in interface DatabasePlatformschemaPlusTable - The schema and name of the tablecolumnNames - The names of the columns with data
public String sqlInsertRowDefaults(SchemaQualifiedName schemaPlusTable,
String[] idColumnNames)
sqlInsertRowDefaults in interface DatabasePlatformschemaPlusTable - The schema and name of the tableidColumnNames - The names of the columns to insert the default
public String sqlQueryForIds(String schemaPlusTable,
String[] idColumnNames,
int limit)
sqlQueryForIds in interface DatabasePlatformX
public String sqlQueryForIdsWithSort(String schemaPlusTable,
String[] idColumnNames,
int limit,
SortColumn[] sortCols)
sqlQueryForIdsWithSort in interface DatabasePlatformX
public String sqlDropIndex(String schemaPlusTable,
String indexName)
sqlDropIndex in interface DatabasePlatform
public String sqlDropColumn(String schemaPlusTable,
String columnName)
sqlDropColumn in interface DatabasePlatformXpublic String sqlDropTable(String schemaPlusTable)
sqlDropTable in interface DatabasePlatform
public String sqlCreateView(String schemaPlusView,
String sql)
sqlCreateView in interface DatabasePlatformXpublic String sqlDropView(String schemaPlusView)
sqlDropView in interface DatabasePlatformXpublic String sqlDropSequence(String schemaPlusSequence)
sqlDropSequence in interface DatabasePlatformpublic String sqlCount(SchemaQualifiedName schemaPlusTable)
sqlCount in interface DatabasePlatform
public SQLSelectStatement sqlSelectInList(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String inClauseColName,
DBDatabaseInfo.ColumnSQLType inClauseColType,
Collection ids)
sqlSelectInList in interface DatabasePlatformschemaPlusTable - The schema and name of the tableselectElements - Set of elements to selectinClauseColName - inClauseColType -
public SQLSelectStatement sqlSelectPS(SchemaQualifiedName schemaPlusTable,
List<SQLSelectElement> selectElements,
String idCol)
sqlSelectPS in interface DatabasePlatformselectElements - The element that the statement should selectidCol - The column to use for the bound variable in the where clauseschemaPlusTable - The table
public String sqlSelect(String schemaPlusTable,
String columns,
String idColumnName)
sqlSelect in interface DatabasePlatformX
public String sqlSelectDistinct(SchemaQualifiedName schemaPlusTable,
String[] columnNames)
sqlSelectDistinct in interface DatabasePlatform
public String sqlAddColumn(String schemaPlusTable,
String colName,
String colClass,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
sqlAddColumn in interface DatabasePlatform
public String sqlFullColumnDefinition(String colClassName,
String nativeType,
String columnDefinition,
String defaultValue,
boolean isNotNull)
sqlFullColumnDefinition in interface DatabasePlatformcolClassName - The name of the columns data type e.g. java.lang.StringnativeType - THe column type e.g. VARCHARcolumnDefinition - defaultValue - isNotNull -
public String sqlLastId(SchemaQualifiedName schemaPlusTable)
sqlLastId in interface DatabasePlatform
public String sqlSort(List ids,
SortColumn[] sortCols,
SchemaQualifiedName schemaPlusTable,
String selectCol,
DBDatabaseInfo.ColumnSQLType selectColType)
sqlSort in interface DatabasePlatformX
public String sqlDeleteRow(String schemaPlusTable,
String whereClause)
DatabasePlatform
sqlDeleteRow in interface DatabasePlatformschemaPlusTable - The schema and name of the table to delete fromwhereClause - The "WHERE" part of the SQL delete command.
public String sqlAlterTableName(String oldSchemaPlusTable,
String newSchemaPlusTable)
sqlAlterTableName in interface DatabasePlatformX
public String sqlAlterColumnName(String schemaPlusTable,
String oldName,
String newName,
String definition)
sqlAlterColumnName in interface DatabasePlatformX
public String sqlAlterColumnSize(String schemaPlusTable,
String columnName,
String columnDefinition)
sqlAlterColumnSize in interface DatabasePlatformX
public String sqlAddIndex(String indexName,
String indexType,
String schemaPlusTable,
String[] columns,
boolean[] asc)
sqlAddIndex in interface DatabasePlatformindexName - 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 schema and name of 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.
public String sqlAddUniqueConstraint(String consName,
String schemaPlusTable,
String[] columns)
sqlAddUniqueConstraint in interface DatabasePlatformconsName - The c onstraint nameschemaPlusTable - The schema and name of the tablecolumns - The c olumns which will form the unique key. Order is important.
public String getColumnListCommaSeparated(String[] columns)
getColumnListCommaSeparated in interface DatabasePlatformXcolumns -
public String sqlDropPrimaryConstraint(String schemaPlusTable,
String consName,
String[] columns)
sqlDropPrimaryConstraint in interface DatabasePlatform
public String sqlDropUniqueConstraint(String schemaPlusTable,
String consName,
String[] columns)
sqlDropUniqueConstraint in interface DatabasePlatform
public static boolean stringArrayContains(String[] hayStack,
String needle)
public String sqlViewMetaDataNextIndex()
sqlViewMetaDataNextIndex in interface DatabasePlatformXpublic String sqlViewMetaDataInsert()
sqlViewMetaDataInsert in interface DatabasePlatformXpublic String sqlSchemaMetaDataNextIndex()
sqlSchemaMetaDataNextIndex in interface DatabasePlatformXpublic String sqlSchemaMetaDataInsert()
sqlSchemaMetaDataInsert in interface DatabasePlatformXpublic String sqlGenericItemInsert()
sqlGenericItemInsert in interface DatabasePlatformXpublic String sqlGenericItemDelete()
sqlGenericItemDelete in interface DatabasePlatformXpublic String sqlGenericItemUpdate()
sqlGenericItemUpdate in interface DatabasePlatformX
public String sqlAddForeignKey(String fkName,
String parentSchemaPlusTable,
String dependentSchemaPlusTable,
String[] parentCols,
String[] dependentCols,
String onDeleteRule,
String onUpdateRule)
sqlAddForeignKey in interface DatabasePlatform
public String sqlDropForeignKey(String schemaPlusTable,
String fkName)
sqlDropForeignKey in interface DatabasePlatform
protected String sqlDropConstraint(String schemaPlusTable,
String constraintName)
public DataAccessException translateSQLException(String message,
String sql,
SQLException ex)
translateSQLException in interface DatabasePlatformpublic String getAddUserSql()
getAddUserSql in interface DatabasePlatformpublic String getDeleteUserSql()
getDeleteUserSql in interface DatabasePlatformpublic String getUpdatePasswordSql()
getUpdatePasswordSql in interface DatabasePlatformpublic String getSetEnabledSql()
getSetEnabledSql in interface DatabasePlatformpublic String getAddAuthoritySql()
getAddAuthoritySql in interface DatabasePlatformpublic String getDeleteAuthoritiesSql()
getDeleteAuthoritiesSql in interface DatabasePlatform
public String sqlSelectDuplicateRows(String schemaPlusTable,
String[] columns)
sqlSelectDuplicateRows in interface DatabasePlatform
public Map<String,DBTableInfo> buildTableInfos(String dbSchemaName,
List<String> tablesToInit,
LazyLoader lazyLoader,
DFFeedback feedback)
DatabasePlatform
buildTableInfos in interface DatabasePlatform
public Map<String,DBTableInfo> buildTableInfosLazy(String dbSchemaName,
LazyLoader lazyLoader,
DFFeedback feedback)
buildTableInfosLazy in interface DatabasePlatform
public Map<String,DBTableInfo> buildTableInfosEager(String dbSchemaName,
DFFeedback feedback)
buildTableInfosEager in interface DatabasePlatformprotected String sqlGetTablesWithPropertyColumns()
protected Set<String> findJChemPropertyTables()
protected abstract void readPropertyTables(Set<String> tables,
ResultSet rs)
throws SQLException
SQLException
protected void readPropertyTablesNoSchema(Set<String> tables,
ResultSet rs)
throws SQLException
SQLException
protected void readPropertyTablesWithSchema(Set<String> tables,
ResultSet rs)
throws SQLException
SQLException
public DBTableInfo buildTableInfo(String dbSchemaName,
String tableName,
LazyLoader lazyLoader,
DFFeedback feedback)
DatabasePlatform
buildTableInfo in interface DatabasePlatformdbSchemaName - The schema in which the table residestableName - The table name
public DBTableInfo buildTableInfoFull(String dbSchemaName,
String tableName,
LazyLoader lazyLoader,
DFFeedback feedback)
buildTableInfoFull in interface DatabasePlatformprotected Map<String,List<DBConstraintInfo>> buildConstraintInfosForSchema(String dbSchemaName)
dbSchemaName -
protected List<DBConstraintInfo> buildConstraintInfosImpl(String dbSchemaName,
String tableName,
List<DBColInfo> collsInTable)
dbSchemaName - The schematableName - The tablecollsInTable - The columns
public TermEncoder getTermEncoder()
getTermEncoder in interface DatabasePlatformXpublic String getCartridgeOwner()
getCartridgeOwner in interface DatabasePlatformXpublic String getCallType()
public void setCallType(String callType)
protected String sqlJChemCartridgeOwner()
protected String sqlJChemCartridgeEnvironment()
public void checkSchemaExistence(String schemaId)
throws SchemaDoesNotExistException
DatabasePlatform
checkSchemaExistence in interface DatabasePlatformSchemaDoesNotExistException
public void updateHeartbeat(String userName,
String schemaId)
DatabasePlatform
updateHeartbeat in interface DatabasePlatformuserName - 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 | ||||||||