private void syncSchemaTables(DbPlatform dbPlatform, RichIterable<TableSyncSide> syncSides, File outputDir) { for (TableSyncSide syncSide : syncSides) { syncSide.enrichTables(dbPlatform); } RichIterable<DaTable> idealTables = this.createIdealTables(syncSides); MapIterable<String, DaTable> idealTablesMap = idealTables.groupByUniqueKey(DaNamedObject.TO_NAME); System.out.println("Starting the alters"); for (TableSyncSide syncSide : syncSides) { for (DaTable table : syncSide.getTables()) { File outputFile = new File(new File(outputDir, syncSide.getSchema().getPhysicalName()), table.getName() + ".sql"); this.generateDiffsToTable(table, idealTablesMap.get(table.getName()), outputFile); } } }
private void syncSchemaTables(DbPlatform dbPlatform, RichIterable<TableSyncSide> syncSides, File outputDir) { for (TableSyncSide syncSide : syncSides) { syncSide.enrichTables(dbPlatform); } RichIterable<DaTable> idealTables = this.createIdealTables(syncSides); MapIterable<String, DaTable> idealTablesMap = idealTables.groupByUniqueKey(DaNamedObject.TO_NAME); System.out.println("Starting the alters"); for (TableSyncSide syncSide : syncSides) { for (DaTable table : syncSide.getTables()) { File outputFile = new File(new File(outputDir, syncSide.getSchema().getPhysicalName()), table.getName() + ".sql"); this.generateDiffsToTable(table, idealTablesMap.get(table.getName()), outputFile); } } }
void enrichTables(DbPlatform dbPlatform) { this.tables = getTables(dbPlatform, this); }
void enrichTables(DbPlatform dbPlatform) { this.tables = getTables(dbPlatform, this); }
@Override public ImmutableCollection<DaTable> valueOf(TableSyncSide object) { return object.getTables(); } };
@Override public ImmutableCollection<DaTable> valueOf(TableSyncSide object) { return object.getTables(); } };