public class ColumnDefinitionChange extends ColumnChangeImplBase
| Constructor and Description |
|---|
ColumnDefinitionChange(String tableName,
String columnName,
Column newColumnDef)
Creates a new change object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Database model,
boolean caseSensitive)
Applies this change to the given database.
|
Column |
getNewColumn()
Returns the new column definition.
|
static boolean |
isAutoIncrementChanged(Column sourceColumn,
Column targetColumn)
Determines whether the auto increment status of the given target column is different from that of the given source column.
|
static boolean |
isChanged(PlatformInfo platformInfo,
Column sourceColumn,
Column targetColumn)
Determines whether the definition of the given target column is different from the one of the given source column.
|
static boolean |
isDefaultValueChanged(Column sourceColumn,
Column targetColumn)
Determines whether the default value of the given target column is different from the one of the given source column.
|
static boolean |
isRequiredStatusChanged(Column sourceColumn,
Column targetColumn)
Determines whether the required status of the given target column is different from that of the given source column.
|
static boolean |
isSizeChanged(PlatformInfo platformInfo,
Column sourceColumn,
Column targetColumn)
Determines whether the size or precision/scale of the given target column is different from that of the given source column.
|
static boolean |
isSizeReduced(PlatformInfo platformInfo,
Column sourceColumn,
Column targetColumn)
Determines whether the size or precision/scale of the given target column is smaller than that of the given source column.
|
static boolean |
isTypeChanged(PlatformInfo platformInfo,
Column sourceColumn,
Column targetColumn)
Determines whether the jdbc type of the given target column is different from the one of the given source column.
|
findChangedColumn, getChangedColumnfindChangedTable, getChangedTableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindChangedTable, getChangedTablepublic Column getNewColumn()
public static boolean isChanged(PlatformInfo platformInfo, Column sourceColumn, Column targetColumn)
platformInfo - The info object for the current platformsourceColumn - The source columntargetColumn - The target columntrue if the definitions differpublic static boolean isTypeChanged(PlatformInfo platformInfo, Column sourceColumn, Column targetColumn)
platformInfo - The info object for the current platformsourceColumn - The source columntargetColumn - The target columntrue if the jdbc types differpublic static boolean isSizeChanged(PlatformInfo platformInfo, Column sourceColumn, Column targetColumn)
false is returned.platformInfo - The info object for the current platformsourceColumn - The source columntargetColumn - The target columntrue if the sizes or precisions/scales differpublic static boolean isSizeReduced(PlatformInfo platformInfo, Column sourceColumn, Column targetColumn)
false is returned. Note that for
columns with precision & scale, it also counted as being smaller if the scale of the target column is smaller than the
one of the source column, regardless of whether the precision of the target column is smaller than precision of the source
column or equal to it or even bigger. The reason for this is that the reduced scale would still potentially lead to truncation
errors.platformInfo - The info object for the current platformsourceColumn - The source columntargetColumn - The target columntrue if the size of the target column is smallerpublic static boolean isDefaultValueChanged(Column sourceColumn, Column targetColumn)
sourceColumn - The source columntargetColumn - The target columntrue if the default values differpublic static boolean isRequiredStatusChanged(Column sourceColumn, Column targetColumn)
sourceColumn - The source columntargetColumn - The target columntrue if the required status is different in the target columnpublic static boolean isAutoIncrementChanged(Column sourceColumn, Column targetColumn)
sourceColumn - The source columntargetColumn - The target columntrue if the auto increment status is different in the target columnpublic void apply(Database model, boolean caseSensitive)
model - The databasecaseSensitive - Whether the case of names mattersCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.