/**
   * Write check constraints associated with the specified table (if any)
   *
   * @param table Table
   * @param html LineWriter
   * @throws IOException
   * @return int
   */
  private int writeCheckConstraints(Table table, LineWriter html) throws IOException {
    Map<String, String> constraints = table.getCheckConstraints(); // constraint name -> text pairs
    int constraintsWritten = 0;
    for (String name : constraints.keySet()) {
      html.writeln(" <tr>");
      html.write("  <td class='detail' valign='top'><a href='tables/");
      html.write(table.getName());
      html.write(".html'>");
      html.write(table.getName());
      html.write("</a></td>");
      html.write("  <td class='detail' valign='top'>");
      html.write(name);
      html.writeln("</td>");
      html.write("  <td class='detail'>");
      html.write(HtmlEncoder.encodeString(constraints.get(name).toString()));
      html.writeln("</td>");
      html.writeln(" </tr>");
      ++constraintsWritten;
    }

    return constraintsWritten;
  }