Package org.jumpmind.db.alter
Class AddForeignKeyChange
java.lang.Object
org.jumpmind.db.alter.TableChangeImplBase
org.jumpmind.db.alter.AddForeignKeyChange
- All Implemented Interfaces:
IModelChange
,TableChange
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.
-
Constructor Summary
ConstructorsConstructorDescriptionAddForeignKeyChange
(Table table, ForeignKey newForeignKey) Creates a new change object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies this change to the given database.Returns the new foreign key.Methods inherited from class org.jumpmind.db.alter.TableChangeImplBase
getChangedTable
-
Constructor Details
-
AddForeignKeyChange
Creates a new change object.- Parameters:
table
- The table to add the foreign key tonewForeignKey
- The new foreign key
-
-
Method Details
-
getNewForeignKey
Returns the new foreign key.- Returns:
- The new foreign key
-
apply
Applies this change to the given database.- Parameters:
database
- The databasecaseSensitive
- Whether the case of names matters
-