Class ModelContainer
- java.lang.Object
-
- io.ebeaninternal.dbmigration.model.ModelContainer
-
public class ModelContainer extends Object
Holds all the tables, views, indexes etc that represent the model.Migration changeSets can be applied to the model.
-
-
Constructor Summary
Constructors Constructor Description ModelContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIndex(MIndex index)Add an index.MTableaddTable(MTable table)Add a table (typically from reading EbeanServer meta data).voidaddTableElementCollection(MTable table)Add an element table taking into account if it is reused/references back to multiple bean types (and so can't have foreign key).voidadjustDraftReferences()Adjust the FK references on all the draft tables.Collection<MIndex>allIndexes()voidapply(Migration migration, io.ebean.migration.MigrationVersion version)Apply a migration with associated changeSets to the model.booleandropIndex(MIndex existingIndex)Return true if the index does not exist and should be dropped.MIndexgetIndex(MIndex newIndex)Lookup the matching index during DIFF migration processing.List<MTable>getPartitionedTables()Return the list of partitioned tables.List<String>getPendingDrops()Return the list of versions containing un-applied pending drops.Set<String>getSchemas()Return the schemas.MTablegetTable(String tableName)Return the table by name.Map<String,MTable>getTables()Return the map of all the tables.booleanisTablePartitioning()Return true if the model contains tables that are partitioned.MigrationmigrationForPendingDrop(String pendingVersion)Return the migration for the pending drops for a given version.voidregisterPendingHistoryDropColumns(ChangeSet changeSet)Register any pending drop columns on history tables.voidregisterPendingHistoryDropColumns(ModelContainer newModel)Register the drop columns on history tables that have not been applied yet.
-
-
-
Constructor Detail
-
ModelContainer
public ModelContainer()
-
-
Method Detail
-
getSchemas
public Set<String> getSchemas()
Return the schemas.
-
isTablePartitioning
public boolean isTablePartitioning()
Return true if the model contains tables that are partitioned.
-
getPartitionedTables
public List<MTable> getPartitionedTables()
Return the list of partitioned tables.
-
adjustDraftReferences
public void adjustDraftReferences()
Adjust the FK references on all the draft tables.
-
getIndex
public MIndex getIndex(MIndex newIndex)
Lookup the matching index during DIFF migration processing.
-
allIndexes
public Collection<MIndex> allIndexes()
-
dropIndex
public boolean dropIndex(MIndex existingIndex)
Return true if the index does not exist and should be dropped.
-
apply
public void apply(Migration migration, io.ebean.migration.MigrationVersion version)
Apply a migration with associated changeSets to the model.
-
addTable
public MTable addTable(MTable table)
Add a table (typically from reading EbeanServer meta data).
-
addTableElementCollection
public void addTableElementCollection(MTable table)
Add an element table taking into account if it is reused/references back to multiple bean types (and so can't have foreign key).
-
getPendingDrops
public List<String> getPendingDrops()
Return the list of versions containing un-applied pending drops.
-
migrationForPendingDrop
public Migration migrationForPendingDrop(String pendingVersion)
Return the migration for the pending drops for a given version.
-
registerPendingHistoryDropColumns
public void registerPendingHistoryDropColumns(ModelContainer newModel)
Register the drop columns on history tables that have not been applied yet.
-
registerPendingHistoryDropColumns
public void registerPendingHistoryDropColumns(ChangeSet changeSet)
Register any pending drop columns on history tables. These columns are now not in the current logical model but we still need to include them in the history views and triggers until they are actually dropped.
-
-