public class SybaseBuilder extends SqlBuilder
_log, LINE_SEPARATOR, SIZE_PLACEHOLDER| Constructor and Description |
|---|
SybaseBuilder(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 |
changeColumn(Table table,
Column column,
Column newColumn)
Writes the SQL to change the given column.
|
void |
changeColumnDefaultValue(Table table,
Column column,
String newDefaultValue)
Writes the SQL to set the default value of the given column.
|
protected void |
copyData(Table sourceTable,
Table targetTable)
Writes a statement that copies the data from the source to the target table.
|
void |
createTable(Database database,
Table table,
Map parameters)
Outputs the DDL to create the table along with any non-external constraints as well
as with external primary keys and indices (but not foreign keys).
|
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 |
dropForeignKeys(Table table)
Creates external foreignkey drop statements.
|
void |
dropIndex(Table table,
Index index)
Generates the statement to drop a non-embedded index from the database.
|
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.
|
protected String |
getDisableIdentityOverrideSql(Table table)
Returns the SQL to disable identity override mode.
|
protected String |
getEnableIdentityOverrideSql(Table table)
Returns the SQL to enable identity override mode.
|
protected String |
getNativeDefaultValue(Column column)
Returns the native default value for the column.
|
protected String |
getQuotationOnStatement()
Returns the statement that turns on the ability to write delimited identifiers.
|
String |
getSelectLastIdentityValues(Table table)
Generates the SQL for querying the id that was created in the last insertion
operation.
|
void |
turnOffIdentityOverride(Table table)
Writes the statement that turns off identity override mode.
|
void |
turnOnIdentityOverride(Table table)
Writes the statement that turns on identity override mode.
|
void |
turnOnQuotation()
Writes the statement that turns on the ability to write delimited identifiers.
|
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 |
writeColumn(Table table,
Column column)
Outputs the DDL for the specified column.
|
protected void |
writeTableCreationStmtEnding(Table table,
Map parameters)
Writes the end of the table creation statement.
|
addEscapedCharSequence, areEqual, columnsDiffer, createForeignKey, createForeignKeys, createForeignKeys, createIndex, createIndexes, createPrimaryKey, createTable, createTables, createTables, createTables, createTemporaryTable, createUniqueIdentifier, dropTable, dropTables, dropTemporaryTable, escapeStringValue, getBareNativeType, getColumnName, getConstraintName, getDefaultValueHelper, getDeleteSql, getDelimitedIdentifier, getForeignKeyName, getIndent, getIndexName, getInsertSql, getMaxColumnNameLength, getMaxConstraintNameLength, getMaxForeignKeyNameLength, getMaxTableNameLength, 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, writeColumnAutoIncrementStmt, writeColumnDefaultValue, writeColumnDefaultValueStmt, writeColumnNotNullableStmt, writeColumnNullableStmt, writeColumns, writeEmbeddedForeignKeysStmt, writeEmbeddedIndexCreateStmt, writeEmbeddedIndicesStmt, writeEmbeddedPrimaryKeysStmt, writeForeignKeyOnDeleteAction, writeForeignKeyOnUpdateAction, writeForeignReferences, writeLocalReferences, writePrimaryKeyStmt, writeTableAlterStmt, writeTableComment, writeTableCreationStmtpublic SybaseBuilder(Platform platform)
platform - The plaftform this builder belongs topublic void createTable(Database database, Table table, Map parameters) throws IOException
createTable in class SqlBuilderdatabase - The database modeltable - The tableparameters - Additional platform-specific parameters for the table creationIOExceptionprotected void writeTableCreationStmtEnding(Table table, Map parameters) throws IOException
writeTableCreationStmtEnding in class SqlBuildertable - The tableparameters - Additional platform-specific parameters for the table creationIOExceptionprotected void writeColumn(Table table, Column column) throws IOException
writeColumn in class SqlBuildertable - The table containing the columncolumn - The columnIOExceptionprotected String getNativeDefaultValue(Column column)
getNativeDefaultValue in class SqlBuildercolumn - The columnpublic void dropTable(Table table) throws IOException
SqlBuilder.dropTable(Database, Table)
if you want that.dropTable in class SqlBuildertable - The table to dropIOExceptionpublic void dropForeignKey(Table table, ForeignKey foreignKey) throws IOException
dropForeignKey in class SqlBuildertable - The tableforeignKey - The foreign keyIOExceptionpublic void dropIndex(Table table, Index index) throws IOException
dropIndex in class SqlBuildertable - The table the index is onindex - The index to dropIOExceptionpublic void dropForeignKeys(Table table) throws IOException
dropForeignKeys in class SqlBuildertable - The tableIOExceptionpublic String getSelectLastIdentityValues(Table table)
null.getSelectLastIdentityValues in class SqlBuildertable - The tablenull if the database does not support thisprotected String getEnableIdentityOverrideSql(Table table)
table - The table to enable the mode forprotected String getDisableIdentityOverrideSql(Table table)
table - The table to disable the mode forprotected String getQuotationOnStatement()
public void turnOnQuotation()
throws IOException
IOExceptionpublic void turnOnIdentityOverride(Table table) throws IOException
table - The table to enable the mode forIOExceptionpublic void turnOffIdentityOverride(Table table) throws IOException
table - The table to disable the mode forIOExceptionprotected void copyData(Table sourceTable, Table targetTable) throws IOException
SqlBuilder.writeCastExpression(Column, Column) method.copyData in class SqlBuildersourceTable - The source tabletargetTable - The target tableIOExceptionprotected void writeCastExpression(Column sourceColumn, Column targetColumn) throws IOException
writeCastExpression in class SqlBuildersourceColumn - The source columntargetColumn - The target columnIOExceptionpublic 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 changeColumnDefaultValue(Table table, Column column, String newDefaultValue) throws IOException
table - The tablecolumn - The column to changenewDefaultValue - The new default valueIOExceptionpublic void changeColumn(Table table, Column column, Column newColumn) throws IOException
table - The tablecolumn - The column to changenewColumn - The new column definitionIOExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.