org.apache.ddlutils.alteration
Class AddColumnChange

java.lang.Object
  extended by org.apache.ddlutils.alteration.TableChangeImplBase
      extended by org.apache.ddlutils.alteration.AddColumnChange
All Implemented Interfaces:
ModelChange, TableChange

public class AddColumnChange
extends TableChangeImplBase

Represents the addition of a column to a table.

Version:
$Revision: $

Constructor Summary
AddColumnChange(Table table, Column newColumn, Column previousColumn, Column nextColumn)
          Creates a new change object.
 
Method Summary
 void apply(Database database, boolean caseSensitive)
          Applies this change to the given database.
 Column getNewColumn()
          Returns the new column.
 Column getNextColumn()
          Returns the column before which the new column should be added.
 Column getPreviousColumn()
          Returns the column after which the new column should be added.
 boolean isAtEnd()
          Determines whether the column is added at the end (when applied in the order of creation of the changes).
 void setAtEnd(boolean atEnd)
          Specifies whether the column is added at the end (when applied in the order of creation of the changes).
 
Methods inherited from class org.apache.ddlutils.alteration.TableChangeImplBase
getChangedTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddColumnChange

public AddColumnChange(Table table,
                       Column newColumn,
                       Column previousColumn,
                       Column nextColumn)
Creates a new change object.

Parameters:
table - The table to add the column to
newColumn - The new column
previousColumn - The column after which the new column should be added
nextColumn - The column before which the new column should be added
Method Detail

getNewColumn

public Column getNewColumn()
Returns the new column.

Returns:
The new column

getPreviousColumn

public Column getPreviousColumn()
Returns the column after which the new column should be added.

Returns:
The previous column

getNextColumn

public Column getNextColumn()
Returns the column before which the new column should be added.

Returns:
The next column

isAtEnd

public boolean isAtEnd()
Determines whether the column is added at the end (when applied in the order of creation of the changes).

Returns:
true if the column is added at the end

setAtEnd

public void setAtEnd(boolean atEnd)
Specifies whether the column is added at the end (when applied in the order of creation of the changes).

Parameters:
atEnd - true if the column is added at the end

apply

public void apply(Database database,
                  boolean caseSensitive)
Applies this change to the given database.

Parameters:
database - The database
caseSensitive - Whether the case of names matters


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.