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 Details

  • Method Details

    • getSchemas

      public Set<String> getSchemas()
      Return the schemas.
    • isTablePartitioning

      public boolean isTablePartitioning()
      Return true if the model contains tables that are partitioned.
    • getPartitionedTables

      Return the list of partitioned tables.
    • adjustDraftReferences

      public void adjustDraftReferences()
      Adjust the FK references on all the draft tables.
    • getTables

      public Map<String,​MTable> getTables()
      Return the map of all the tables.
    • getTable

      public MTable getTable(String tableName)
      Return the table by name.
    • getIndex

      public MIndex getIndex(MIndex newIndex)
      Lookup the matching index during DIFF migration processing.
    • 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).
    • addIndex

      public void addIndex(MIndex index)
      Add an index.
    • 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

      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.