org.apache.ddlutils.alteration
Class ColumnOrderChange

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

public class ColumnOrderChange
extends TableChangeImplBase

Represents the change of the order of the columns of a table.

Version:
$Revision: $

Constructor Summary
ColumnOrderChange(Table table, Map newPositions)
          Creates a new change object.
 
Method Summary
 void apply(Database database, boolean caseSensitive)
          Applies this change to the given database.
 int getNewPosition(Column sourceColumn)
          Returns the new position of the given source column.
 
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

ColumnOrderChange

public ColumnOrderChange(Table table,
                         Map newPositions)
Creates a new change object.

Parameters:
table - The table whose primary key is to be changed
newPositions - The map containing the new positions keyed by the source columns
Method Detail

getNewPosition

public int getNewPosition(Column sourceColumn)
Returns the new position of the given source column.

Parameters:
sourceColumn - The column
Returns:
The new position or -1 if no position is marked for the column

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.