Package org.jumpmind.db.platform.nuodb
Class NuoDbDdlBuilder
java.lang.Object
org.jumpmind.db.platform.AbstractDdlBuilder
org.jumpmind.db.platform.nuodb.NuoDbDdlBuilder
- 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 TypeMethodDescriptionbooleanareColumnSizesTheSame(Column sourceColumn, Column targetColumn) protected voiddropTable(Table table, StringBuilder ddl, boolean temporary, boolean recreate) Outputs the DDL to drop the table.protected StringThe fully qualified table name shortengetSelectLastIdentityValues(Table table) Generates the SQL for querying the id that was created in the last insertion operation.getSqlType(Column column) Returns the full SQL type specification (including size and precision/scale) for the given column.protected voidprocessChange(Database currentModel, Database desiredModel, AddColumnChange change, StringBuilder ddl) protected voidprocessChange(Database currentModel, Database desiredModel, ColumnDataTypeChange change, StringBuilder ddl) protected voidprocessChange(Database currentModel, Database desiredModel, RemoveColumnChange change, StringBuilder ddl) protected voidprocessColumnChange(Table sourceTable, Table targetTable, Column sourceColumn, Column targetColumn, 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 voidprotected voidwriteColumnAutoIncrementStmt(Table table, Column column, StringBuilder ddl) Prints that the column is an auto increment column.protected voidPrints that a column is nullable.protected voidwriteExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key, StringBuilder ddl) Writes a single foreign key constraint using a alter table statement.protected voidwriteExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey, StringBuilder ddl) Generates the statement to drop a foreignkey constraint from the database using an alter table statement.voidwriteExternalIndexDropStmt(Table table, IIndex index, StringBuilder ddl) Generates the statement to drop a non-embedded index from the database.Methods inherited from class org.jumpmind.db.platform.AbstractDdlBuilder
addEscapedCharSequence, alterDatabase, alterDatabase, alterTable, 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, getGapLimitSize, getIndent, getIndexName, getInsertSql, getNativeDefaultValue, getNativeType, getRealTargetTableFor, getSize, 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, shouldGeneratePrimaryKeys, shouldUseQuotes, writeAlterColumnDataTypeToBigInt, writeCascadeAttributesForForeignKeyDelete, writeCascadeAttributesForForeignKeyUpdate, writeCastExpression, writeColumn, writeColumnDefaultValue, writeColumnDefaultValueStmt, writeColumnEmbeddedPrimaryKey, writeColumnNotNullableStmt, writeColumns, writeColumnType, writeColumnTypeDefaultRequired, writeColumnUniqueStmt, writeCopyDataStatement, writeCopyDataStatement, writeEmbeddedForeignKeysStmt, writeEmbeddedIndexCreateStmt, writeEmbeddedIndicesStmt, writeEmbeddedPrimaryKeysStmt, writeExternalIndexCreate, writeExternalIndexCreateStmt, writeExternalIndicesCreateStmt, writeExternalPrimaryKeysCreateStmt, writeFixLastIdentityValues, writeForeignReferences, writeGeneratedColumn, writeIdentityGapLimit, writeLocalReferences, writePrimaryKeyStmt, writeTableAlterStmt, writeTableComment, writeTableCreationStmt, writeTableCreationStmtEnding
-
Constructor Details
-
NuoDbDdlBuilder
public NuoDbDdlBuilder()
-
-
Method Details
-
getFullyQualifiedTableNameShorten
Description copied from class:AbstractDdlBuilderThe fully qualified table name shorten- Overrides:
getFullyQualifiedTableNameShortenin classAbstractDdlBuilder
-
areColumnSizesTheSame
- Specified by:
areColumnSizesTheSamein interfaceIDdlBuilder- Overrides:
areColumnSizesTheSamein classAbstractDdlBuilder
-
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
-
writeColumnAutoIncrementStmt
Description copied from class:AbstractDdlBuilderPrints that the column is an auto increment column.- Overrides:
writeColumnAutoIncrementStmtin 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
-
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
-
writeExternalForeignKeyCreateStmt
protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key, StringBuilder ddl) Description copied from class:AbstractDdlBuilderWrites a single foreign key constraint using a alter table statement.- Overrides:
writeExternalForeignKeyCreateStmtin classAbstractDdlBuilder- Parameters:
database- The database modeltable- The tablekey- The foreign key
-
writeExternalForeignKeyDropStmt
protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey, StringBuilder ddl) Description copied from class:AbstractDdlBuilderGenerates the statement to drop a foreignkey constraint from the database using an alter table statement.- Overrides:
writeExternalForeignKeyDropStmtin classAbstractDdlBuilder- Parameters:
table- The tableforeignKey- The foreign key
-
writeExternalIndexDropStmt
Description copied from class:AbstractDdlBuilderGenerates the statement to drop a non-embedded index from the database.- Overrides:
writeExternalIndexDropStmtin classAbstractDdlBuilder
-
processChange
protected void processChange(Database currentModel, Database desiredModel, AddColumnChange change, StringBuilder ddl) -
processChange
protected void processChange(Database currentModel, Database desiredModel, RemoveColumnChange change, StringBuilder ddl) -
processChange
protected void processChange(Database currentModel, Database desiredModel, ColumnDataTypeChange change, StringBuilder ddl) -
processColumnChange
protected void processColumnChange(Table sourceTable, Table targetTable, Column sourceColumn, Column targetColumn, StringBuilder ddl) -
writeColumnNullableStmt
Description copied from class:AbstractDdlBuilderPrints that a column is nullable.- Overrides:
writeColumnNullableStmtin classAbstractDdlBuilder
-
writeCascadeAttributesForForeignKey
- Overrides:
writeCascadeAttributesForForeignKeyin classAbstractDdlBuilder
-
getSqlType
Description copied from class:AbstractDdlBuilderReturns the full SQL type specification (including size and precision/scale) for the given column.- Specified by:
getSqlTypein interfaceIDdlBuilder- Overrides:
getSqlTypein classAbstractDdlBuilder- Parameters:
column- The column- Returns:
- The full SQL type string including the size
-