org.apache.ddlutils.alteration
Class AddPrimaryKeyChange

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

public class AddPrimaryKeyChange
extends TableChangeImplBase

Represents the addition of a primary key to a table which does not have one.

Version:
$Revision: $

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

AddPrimaryKeyChange

public AddPrimaryKeyChange(Table table,
                           Column[] primaryKeyColumns)
Creates a new change object.

Parameters:
table - The table to add the primary key to
primaryKeyColumns - The columns making up the primary key
Method Detail

getPrimaryKeyColumns

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

Returns:
The primary key 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.