org.apache.ddlutils.alteration
Class PrimaryKeyChange

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

public class PrimaryKeyChange
extends TableChangeImplBase

Represents the change of the primary key of a table.

Version:
$Revision: $

Constructor Summary
PrimaryKeyChange(Table table, Column[] oldPrimaryKeyColumns, Column[] newPrimaryKeyColumns)
          Creates a new change object.
 
Method Summary
 void apply(Database database, boolean caseSensitive)
          Applies this change to the given database.
 Column[] getNewPrimaryKeyColumns()
          Returns the columns making up the new primary key.
 Column[] getOldPrimaryKeyColumns()
          Returns the columns making up the original primary key.
 
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

PrimaryKeyChange

public PrimaryKeyChange(Table table,
                        Column[] oldPrimaryKeyColumns,
                        Column[] newPrimaryKeyColumns)
Creates a new change object.

Parameters:
table - The table whose primary key is to be changed
oldPrimaryKeyColumns - The columns making up the original primary key
newPrimaryKeyColumns - The columns making up the new primary key
Method Detail

getOldPrimaryKeyColumns

public Column[] getOldPrimaryKeyColumns()
Returns the columns making up the original primary key.

Returns:
The columns

getNewPrimaryKeyColumns

public Column[] getNewPrimaryKeyColumns()
Returns the columns making up the new primary key.

Returns:
The columns

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.