org.apache.ddlutils.alteration
Class AddForeignKeyChange

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

public class AddForeignKeyChange
extends TableChangeImplBase

Represents the addition of a foreign key to a table. Note that for simplicity and because it fits the model, this change actually implements table change for the table that the new foreign key will originate.

Version:
$Revision: $

Constructor Summary
AddForeignKeyChange(Table table, ForeignKey newForeignKey)
          Creates a new change object.
 
Method Summary
 void apply(Database database, boolean caseSensitive)
          Applies this change to the given database.
 ForeignKey getNewForeignKey()
          Returns the new foreign 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

AddForeignKeyChange

public AddForeignKeyChange(Table table,
                           ForeignKey newForeignKey)
Creates a new change object.

Parameters:
table - The table to add the foreign key to
newForeignKey - The new foreign key
Method Detail

getNewForeignKey

public ForeignKey getNewForeignKey()
Returns the new foreign key.

Returns:
The new foreign key

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.