Package org.jumpmind.db.platform.hsqldb2
Class HsqlDb2DdlBuilder
java.lang.Object
org.jumpmind.db.platform.AbstractDdlBuilder
org.jumpmind.db.platform.hsqldb2.HsqlDb2DdlBuilder
- All Implemented Interfaces:
IDdlBuilder
-
Field Summary
Fields inherited from class org.jumpmind.db.platform.AbstractDdlBuilder
caseSensitive, databaseInfo, databaseName, delimitedIdentifierModeOn, log, scriptModeOn, SIZE_PLACEHOLDER, sqlCommentsOn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddropTable(Table table, StringBuilder ddl, boolean temporary, boolean recreate) Outputs the DDL to drop the table.getSelectLastIdentityValues(Table table) Generates the SQL for querying the id that was created in the last insertion operation.protected voidprocessChange(Database currentModel, Database desiredModel, AddColumnChange change, StringBuilder ddl) protected voidprocessChange(Database currentModel, Database desiredModel, RemoveColumnChange change, StringBuilder ddl) protected voidprocessTableStructureChanges(Database currentModel, Database desiredModel, Table sourceTable, Table targetTable, List<TableChange> changes, StringBuilder ddl) Allows database-specific implementations to handle changes in a database specific manner.protected booleanshouldGeneratePrimaryKeys(Column[] primaryKeyColumns) Determines whether we should generate a primary key constraint for the given primary key columns.voidwriteExternalIndexDropStmt(Table table, IIndex index, StringBuilder ddl) Generates the statement to drop a non-embedded index from the database.protected voidwriteGeneratedColumn(Table table, Column column, StringBuilder ddl) Methods inherited from class org.jumpmind.db.platform.AbstractDdlBuilder
addEscapedCharSequence, alterDatabase, alterDatabase, alterTable, areColumnSizesTheSame, areEqual, areMappedTypesTheSame, copy, createBackupTableFor, createExternalForeignKeys, createExternalForeignKeys, createTable, createTable, createTables, createTables, createTemporaryTable, dropExternalForeignKeys, dropTable, dropTables, dropTables, dropTemporaryTable, escapeStringValue, filterChanges, filterColumnSqlType, findCorrespondingForeignKey, findForeignKey, findTable, fixLastIdentityValues, getBackupTableFor, getBareNativeType, getColumnName, getColumnTypeDdl, getConstraintName, getCopyDataColumnMapping, getCopyDataColumnOrderedMapping, getDatabaseInfo, getDefaultValueHelper, getDefinitionForGeneratedColumn, getDeleteSql, getDelimitedIdentifier, getDetectedChanges, getForeignKeyName, getFullyQualifiedIndexNameShorten, getFullyQualifiedTableNameShorten, getGapLimitSize, getIndent, getIndexName, getInsertSql, getNativeDefaultValue, getNativeType, getRealTargetTableFor, getSize, getSqlType, getTableName, getTemporaryTableFor, getTemporaryTableFor, getUpdateSql, getValueAsString, getValueDateFormat, getValueLocale, getValueNumberFormat, getValueTimeFormat, hasSize, initCteExpression, isAlterDatabase, isCaseSensitive, isDelimitedIdentifierModeOn, isFullTextIndex, isScriptModeOn, isSpecifyIdentityGapLimit, isSqlCommentsOn, isValidDefaultValue, mapDefaultValue, mergeOrRemovePlatformTypes, printComment, printDefaultValue, printEndOfStatement, printIdentifier, printIndent, println, println, printlnIdentifier, printStartOfEmbeddedStatement, processChange, processChange, processChange, processChange, processChange, processChange, processChange, processChange, processChange, processChanges, processChanges, processTableStructureChanges, processTableStructureChanges, renameTable, restoreTableFromBackup, setCaseSensitive, setDelimitedIdentifierModeOn, setIndent, setScriptModeOn, setSqlCommentsOn, setValueDateFormat, setValueLocale, setValueNumberFormat, setValueTimeFormat, shortenName, shouldUseQuotes, writeAlterColumnDataTypeToBigInt, writeCascadeAttributesForForeignKey, writeCascadeAttributesForForeignKeyDelete, writeCascadeAttributesForForeignKeyUpdate, writeCastExpression, writeColumn, writeColumnAutoIncrementStmt, writeColumnDefaultValue, writeColumnDefaultValueStmt, writeColumnEmbeddedPrimaryKey, writeColumnNotNullableStmt, writeColumnNullableStmt, writeColumns, writeColumnType, writeColumnTypeDefaultRequired, writeColumnUniqueStmt, writeCopyDataStatement, writeCopyDataStatement, writeEmbeddedForeignKeysStmt, writeEmbeddedIndexCreateStmt, writeEmbeddedIndicesStmt, writeEmbeddedPrimaryKeysStmt, writeExternalForeignKeyCreateStmt, writeExternalForeignKeyDropStmt, writeExternalIndexCreate, writeExternalIndexCreateStmt, writeExternalIndicesCreateStmt, writeExternalPrimaryKeysCreateStmt, writeFixLastIdentityValues, writeForeignReferences, writeIdentityGapLimit, writeLocalReferences, writePrimaryKeyStmt, writeTableAlterStmt, writeTableComment, writeTableCreationStmt, writeTableCreationStmtEnding
-
Constructor Details
-
HsqlDb2DdlBuilder
public HsqlDb2DdlBuilder()
-
-
Method Details
-
dropTable
Description copied from class:AbstractDdlBuilderOutputs the DDL to drop the table. Note that this method does not drop foreign keys to this table. Use#dropTable(Database, Table)if you want that.- Overrides:
dropTablein classAbstractDdlBuilderrecreate- TODO
-
writeGeneratedColumn
- Overrides:
writeGeneratedColumnin classAbstractDdlBuilder
-
getSelectLastIdentityValues
Description copied from class:AbstractDdlBuilderGenerates the SQL for querying the id that was created in the last insertion operation. This is obviously only useful for pk fields that are auto-incrementing. A database that does not support this, will returnnull.- Overrides:
getSelectLastIdentityValuesin classAbstractDdlBuilder- Parameters:
table- The table- Returns:
- The sql, or
nullif the database does not support this
-
shouldGeneratePrimaryKeys
Description copied from class:AbstractDdlBuilderDetermines whether we should generate a primary key constraint for the given primary key columns.- Overrides:
shouldGeneratePrimaryKeysin classAbstractDdlBuilder- Parameters:
primaryKeyColumns- The pk columns- Returns:
trueif a pk statement should be generated for the columns
-
processTableStructureChanges
protected void processTableStructureChanges(Database currentModel, Database desiredModel, Table sourceTable, Table targetTable, List<TableChange> changes, StringBuilder ddl) Description copied from class:AbstractDdlBuilderAllows database-specific implementations to handle changes in a database specific manner. Any handled change should be applied to the given current model (which is a copy of the real original model) and be removed from the list of changes.
In the default implementation, allAddPrimaryKeyChangechanges are applied via anALTER TABLE ADD CONSTRAINTstatement.- Overrides:
processTableStructureChangesin classAbstractDdlBuilder- Parameters:
currentModel- The current database schemadesiredModel- The desired database schemasourceTable- The original tabletargetTable- The desired tablechanges- The change objects for the target table
-
processChange
protected void processChange(Database currentModel, Database desiredModel, AddColumnChange change, StringBuilder ddl) -
processChange
protected void processChange(Database currentModel, Database desiredModel, RemoveColumnChange change, StringBuilder ddl) -
writeExternalIndexDropStmt
Description copied from class:AbstractDdlBuilderGenerates the statement to drop a non-embedded index from the database.- Overrides:
writeExternalIndexDropStmtin classAbstractDdlBuilder
-