public List<SQLForeignKey> build(Configuration conf) throws MetaException {
    checkBuildable("to_" + pkTable + "_foreign_key", conf);
    if (pkTable == null || pkColumns.isEmpty() || pkName == null) {
      throw new MetaException("You must provide the primary key table, columns, and name");
    }
    if (columns.size() != pkColumns.size()) {
      throw new MetaException("The number of foreign columns must match the number of primary key" +
          " columns");
    }
    List<SQLForeignKey> fk = new ArrayList<>(columns.size());
    for (int i = 0; i < columns.size(); i++) {
      SQLForeignKey keyCol = new SQLForeignKey(pkDb, pkTable, pkColumns.get(i), dbName, tableName,
          columns.get(i), getNextSeq(), updateRule, deleteRule, constraintName, pkName, enable,
          validate, rely);
      keyCol.setCatName(catName);
      fk.add(keyCol);
    }
    return fk;
  }
Builder for {@link SQLForeignKey}.  Requires what {@link ConstraintBuilder} requires, plus
primary key
database, table, column and name.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/SQLForeignKeyBuilder.java