public abstract class AbstractDatabaseType extends Object implements DatabaseType
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALTER_TABLE_DROP_INDEX |
protected static String |
CHANGE_COLUMN_TYPE_CLAUSE_STRUCTURE_STANDARD_ALTER_COLUMN |
protected static String |
CHANGE_COLUMN_TYPE_CLAUSE_STRUCTURE_STANDARD_MODIFY |
protected static String |
DROP_INDEX_SCHEMA_DOT_INDEX |
protected static String |
DROP_INDEX_SCHEMA_DOT_TABLE_DOT_INDEX |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDatabaseType(String name,
String fieldTypeName,
String[] productNamePrefix) |
protected |
AbstractDatabaseType(String name,
String fieldTypeName,
String[] productNamePrefix,
int constraintNameClipLength) |
| Modifier and Type | Method and Description |
|---|---|
String |
getChangeColumnTypeSQL(String tableName,
String columnName,
String targetSqlType)
Builds a DB-specific SQL statement to update a column's type.
|
protected String |
getChangeColumnTypeStructure() |
int |
getConstraintNameClipLength() |
String |
getDropIndexSQL(String schemaName,
String tableName,
String indexName)
Builds a DB-specific SQL statement for dropping index.
|
String |
getDropIndexStructure() |
String |
getFieldTypeName() |
String |
getName() |
String |
getSchemaName(Connection con)
Returns the name of the connected schema.
|
protected static boolean |
isProductNameInPrefixList(String[] productNamePrefixes,
String productName) |
abstract boolean |
matchesConnection(Connection con)
Checks whether the connection object passed in matches the database type represented
by this instance of the DatabaseType class.
|
protected boolean |
productNameMatches(Connection con) |
protected static boolean |
productNamesMatch(String productNamePrefix,
String testName) |
protected void |
registerWithFactory()
Register this database type with DatabaseTypeFactory
|
String |
toString() |
protected boolean |
versionGreaterThanOrEqual(Connection con,
int majorVersion,
int minorVersion) |
protected static boolean |
versionGreaterThanOrEqual(int major1,
int minor1,
int major2,
int minor2)
Compares two version numbers and returns true if the
first version number is greater than the second
|
protected boolean |
versionLessThanOrEqual(Connection con,
int majorVersion,
int minorVersion) |
protected static final String CHANGE_COLUMN_TYPE_CLAUSE_STRUCTURE_STANDARD_ALTER_COLUMN
protected static final String CHANGE_COLUMN_TYPE_CLAUSE_STRUCTURE_STANDARD_MODIFY
protected static final String DROP_INDEX_SCHEMA_DOT_INDEX
protected static final String DROP_INDEX_SCHEMA_DOT_TABLE_DOT_INDEX
protected static final String ALTER_TABLE_DROP_INDEX
protected AbstractDatabaseType(String name, String fieldTypeName, String[] productNamePrefix, int constraintNameClipLength)
public String getName()
getName in interface DatabaseTypepublic String getFieldTypeName()
getFieldTypeName in interface DatabaseTypepublic String getSchemaName(Connection con)
DatabaseTypegetSchemaName in interface DatabaseTypecon - the connection for which to return the schemapublic int getConstraintNameClipLength()
getConstraintNameClipLength in interface DatabaseTypepublic abstract boolean matchesConnection(Connection con) throws SQLException
matchesConnection in interface DatabaseTypeSQLExceptionprotected void registerWithFactory()
protected static boolean versionGreaterThanOrEqual(int major1,
int minor1,
int major2,
int minor2)
major1 - First major version number for comparisonminor1 - First minor version number for comparisonmajor2 - Second major version number for comparisonminor2 - Second minor version number for comparisonprotected static boolean productNamesMatch(String productNamePrefix, String testName)
protected static boolean isProductNameInPrefixList(String[] productNamePrefixes, String productName)
protected boolean productNameMatches(Connection con) throws SQLException
SQLExceptionprotected boolean versionGreaterThanOrEqual(Connection con, int majorVersion, int minorVersion) throws SQLException
SQLExceptionprotected boolean versionLessThanOrEqual(Connection con, int majorVersion, int minorVersion) throws SQLException
SQLExceptionprotected String getChangeColumnTypeStructure()
public final String getChangeColumnTypeSQL(String tableName, String columnName, String targetSqlType)
getChangeColumnTypeSQL in interface DatabaseTypetableName - the name of the table to be changed.columnName - the name of the column to be changed.targetSqlType - the target SQL type of the column.null, if not supported.public String getDropIndexStructure()
public String getDropIndexSQL(String schemaName, String tableName, String indexName)
getDropIndexSQL in interface DatabaseTypeschemaName - the of the schema containing table.tableName - the name of the table to be changed.indexName - the name of the index to be dropped.Copyright © 2016 Atlassian. All rights reserved.