public class SapDbBuilder extends SqlBuilder
_log, LINE_SEPARATOR, SIZE_PLACEHOLDER| Constructor and Description |
|---|
SapDbBuilder(Platform platform)
Creates a new builder instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Database model,
Table table,
Column newColumn)
Prints the SQL for adding a column to a table.
|
void |
changeColumnDefaultValue(Table table,
Column column,
String newDefaultValue)
Writes the SQL to set the default value of the given column.
|
void |
changeColumnRequiredStatus(Table table,
Column column,
boolean isRequired)
Writes the SQL to set the required status of the given column.
|
void |
createPrimaryKey(Table table,
Column[] primaryKeyColumns)
Writes the primary key constraints of the table as alter table statements.
|
void |
dropColumn(Table table,
Column column)
Writes the SQL to drop a column.
|
void |
dropForeignKey(Table table,
ForeignKey foreignKey)
Generates the statement to drop a foreignkey constraint from the database using an
alter table statement.
|
void |
dropPrimaryKey(Table table)
Writes the SQL to drop the primary key of the given table.
|
void |
dropTable(Table table)
Outputs the DDL to drop the table.
|
String |
getSelectLastIdentityValues(Table table)
Generates the SQL for querying the id that was created in the last insertion
operation.
|
protected void |
writeCastExpression(Column sourceColumn,
Column targetColumn)
Writes a cast expression that converts the value of the source column to the data type
of the target column.
|
protected void |
writeColumnAutoIncrementStmt(Table table,
Column column)
Prints that the column is an auto increment column.
|
protected void |
writeForeignKeyOnDeleteAction(Table table,
ForeignKey foreignKey)
Writes the onDelete action for the given foreign key.
|
addEscapedCharSequence, areEqual, columnsDiffer, copyData, createForeignKey, createForeignKeys, createForeignKeys, createIndex, createIndexes, createTable, createTable, createTables, createTables, createTables, createTemporaryTable, createUniqueIdentifier, dropForeignKeys, dropIndex, dropTable, dropTables, dropTemporaryTable, escapeStringValue, getBareNativeType, getColumnName, getConstraintName, getDefaultValueHelper, getDeleteSql, getDelimitedIdentifier, getForeignKeyName, getIndent, getIndexName, getInsertSql, getMaxColumnNameLength, getMaxConstraintNameLength, getMaxForeignKeyNameLength, getMaxTableNameLength, getNativeDefaultValue, getNativeType, getPlatform, getPlatformInfo, getSizeSpec, getSqlType, getSqlType, getTableName, getUpdateSql, getUpdateSql, getValueAsString, getValueDateFormat, getValueLocale, getValueNumberFormat, getValueTimeFormat, getWriter, isValidDefaultValue, print, printComment, printDefaultValue, printEndOfStatement, printIdentifier, printIndent, println, println, printlnIdentifier, printStartOfEmbeddedStatement, setIndent, setValueDateFormat, setValueLocale, setValueNumberFormat, setValueTimeFormat, setWriter, shortenName, shouldGeneratePrimaryKeys, writeAddIdentityColumnUsingAlterTable, writeColumn, writeColumnDefaultValue, writeColumnDefaultValueStmt, writeColumnNotNullableStmt, writeColumnNullableStmt, writeColumns, writeEmbeddedForeignKeysStmt, writeEmbeddedIndexCreateStmt, writeEmbeddedIndicesStmt, writeEmbeddedPrimaryKeysStmt, writeForeignKeyOnUpdateAction, writeForeignReferences, writeLocalReferences, writePrimaryKeyStmt, writeTableAlterStmt, writeTableComment, writeTableCreationStmt, writeTableCreationStmtEndingpublic SapDbBuilder(Platform platform)
platform - The plaftform this builder belongs topublic void dropTable(Table table) throws IOException
SqlBuilder.dropTable(Database, Table)
if you want that.dropTable in class SqlBuildertable - The table to dropIOExceptionprotected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
writeColumnAutoIncrementStmt in class SqlBuildertable - The tablecolumn - The columnIOExceptionpublic void createPrimaryKey(Table table, Column[] primaryKeyColumns) throws IOException
createPrimaryKey in class SqlBuildertable - The tableprimaryKeyColumns - The primary key columnsIOExceptionprotected void writeForeignKeyOnDeleteAction(Table table, ForeignKey foreignKey) throws IOException
writeForeignKeyOnDeleteAction in class SqlBuildertable - The tableforeignKey - The foreignkeyIOExceptionpublic void dropForeignKey(Table table, ForeignKey foreignKey) throws IOException
dropForeignKey in class SqlBuildertable - The tableforeignKey - The foreign keyIOExceptionpublic String getSelectLastIdentityValues(Table table)
null.getSelectLastIdentityValues in class SqlBuildertable - The tablenull if the database does not support thispublic void addColumn(Database model, Table table, Column newColumn) throws IOException
addColumn in class SqlBuildermodel - The database modeltable - The tablenewColumn - The new columnIOExceptionpublic void dropColumn(Table table, Column column) throws IOException
table - The tablecolumn - The column to dropIOExceptionpublic void dropPrimaryKey(Table table) throws IOException
table - The tableIOExceptionpublic void changeColumnRequiredStatus(Table table, Column column, boolean isRequired) throws IOException
table - The tablecolumn - The column to changeisRequired - Whether the column shall be requiredIOExceptionpublic void changeColumnDefaultValue(Table table, Column column, String newDefaultValue) throws IOException
table - The tablecolumn - The column to changenewDefaultValue - The new default valueIOExceptionprotected void writeCastExpression(Column sourceColumn, Column targetColumn) throws IOException
writeCastExpression in class SqlBuildersourceColumn - The source columntargetColumn - The target columnIOExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.