Class MCompoundForeignKey
java.lang.Object
io.ebeaninternal.dbmigration.model.MCompoundForeignKey
public class MCompoundForeignKey extends Object
A unique constraint for multiple columns.
Note that unique constraint on a single column is instead a boolean flag on the associated MColumn.
-
Constructor Summary
Constructors Constructor Description MCompoundForeignKey(String name, String referenceTable, String indexName) -
Method Summary
Modifier and Type Method Description voidaddColumnPair(String dbCol, String refColumn)Add a column pair of local and referenced column.AlterForeignKeyaddForeignKey(String tableName)Create and return an AlterForeignKey migration element.voidaddNameSuffix(int counter)Add a counter to the foreign key and index names to avoid duplication.ForeignKeycreateForeignKey()Create and return an ForeignKey migration element.AlterForeignKeydropForeignKey(String tableName)Create and return an AlterForeignKey migration element.booleanequals(Object obj)List<String>getColumns()Return the columns making up the foreign key in order.StringgetIndexName()Return the index name.StringgetName()Return the foreign key name.inthashCode()voidsetIndexName(String indexName)Set the associated index name.
-
Constructor Details
-
MCompoundForeignKey
-
-
Method Details
-
addColumnPair
Add a column pair of local and referenced column. -
createForeignKey
Create and return an ForeignKey migration element. -
addForeignKey
Create and return an AlterForeignKey migration element. -
dropForeignKey
Create and return an AlterForeignKey migration element. -
addNameSuffix
Add a counter to the foreign key and index names to avoid duplication. -
getName
Return the foreign key name. -
getIndexName
Return the index name. -
getColumns
Return the columns making up the foreign key in order. -
setIndexName
Set the associated index name. Note that setting to null has the effect of indicating an associated index should not be created for this foreign key. -
hashCode
-
equals
-