private ForeignKey findCorrespondingForeignKey(Table table,ForeignKey fk){
  for (int fkIdx=0; fkIdx < table.getForeignKeyCount(); fkIdx++) {
    ForeignKey curFk=table.getForeignKey(fkIdx);
    if ((caseSensitive && fk.equals(curFk)) || (!caseSensitive && fk.equalsIgnoreCase(curFk))) {
      return curFk;
    }
  }
  return null;
}

private ForeignKey findCorrespondingForeignKey ( Table table , ForeignKey fk ) { for ( int fkIdx = 0 ; fkIdx < table . getForeignKeyCount ( ) ; fkIdx ++ ) { ForeignKey curFk = table . getForeignKey ( fkIdx ) ; if ( ( caseSensitive && fk . equals ( curFk ) ) || ( ! caseSensitive && fk . equalsIgnoreCase ( curFk ) ) ) { return curFk ; } } return null ; }
searches in the given table for a corresponding foreign key . if the given key has no name , then a foreign key to the same table with the same columns ( but not necessarily in the same order ) is searched . if the given key has a name , then the corresponding key also needs to have the same name , or no name at all , but not a different one .
