private void addRelevantFKsFromUnchangedTables(Database currentModel,Database desiredModel,Set<String> namesOfKnownChangedTables,Map<String,List<ForeignKey>> fksPerTable){
  boolean caseSensitive=delimitedIdentifierModeOn;
  for (int tableIdx=0; tableIdx < desiredModel.getTableCount(); tableIdx++) {
    Table targetTable=desiredModel.getTable(tableIdx);
    String name=targetTable.getName();
    Table sourceTable=currentModel.findTable(name,caseSensitive);
    List<ForeignKey> relevantFks=null;
    if (!caseSensitive) {
      name=name.toUpperCase();
    }
    if ((sourceTable != null) && !namesOfKnownChangedTables.contains(name)) {
      for (int fkIdx=0; fkIdx < targetTable.getForeignKeyCount(); fkIdx++) {
        ForeignKey targetFk=targetTable.getForeignKey(fkIdx);
        ForeignKey sourceFk=sourceTable.findForeignKey(targetFk,caseSensitive);
        String refName=targetFk.getForeignTableName();
        if (!caseSensitive) {
          refName=refName.toUpperCase();
        }
        if ((sourceFk != null) && namesOfKnownChangedTables.contains(refName)) {
          if (relevantFks == null) {
            relevantFks=new ArrayList<ForeignKey>();
            fksPerTable.put(name,relevantFks);
          }
          relevantFks.add(targetFk);
        }
      }
    }
  }
}

private void addRelevantFKsFromUnchangedTables ( Database currentModel , Database desiredModel , Set < String > namesOfKnownChangedTables , Map < String , List < ForeignKey > > fksPerTable ) { boolean caseSensitive = delimitedIdentifierModeOn ; for ( int tableIdx = 0 ; tableIdx < desiredModel . getTableCount ( ) ; tableIdx ++ ) { Table targetTable = desiredModel . getTable ( tableIdx ) ; String name = targetTable . getName ( ) ; Table sourceTable = currentModel . findTable ( name , caseSensitive ) ; List < ForeignKey > relevantFks = null ; if ( ! caseSensitive ) { name = name . toUpperCase ( ) ; } if ( ( sourceTable != null ) && ! namesOfKnownChangedTables . contains ( name ) ) { for ( int fkIdx = 0 ; fkIdx < targetTable . getForeignKeyCount ( ) ; fkIdx ++ ) { ForeignKey targetFk = targetTable . getForeignKey ( fkIdx ) ; ForeignKey sourceFk = sourceTable . findForeignKey ( targetFk , caseSensitive ) ; String refName = targetFk . getForeignTableName ( ) ; if ( ! caseSensitive ) { refName = refName . toUpperCase ( ) ; } if ( ( sourceFk != null ) && namesOfKnownChangedTables . contains ( refName ) ) { if ( relevantFks == null ) { relevantFks = new ArrayList < ForeignKey > ( ) ; fksPerTable . put ( name , relevantFks ) ; } relevantFks . add ( targetFk ) ; } } } } }
adds the foreign keys of the unchanged tables that reference changed tables to the given map .
