StringBuffer result = new StringBuffer();  List columns = new ArrayList(); columns.addAll(m_columns.keySet()); Collections.sort(columns);  for (int i = 0; i < columns.size(); i++) { String colName = (String) columns.get(i); Column col = getColumn(colName); if (col.hasPrimaryKey()) { columns.remove(i); columns.add(0, colName); } }  result.append("create table " + getName() + " (\n");  String comment = null; for (int i = 0; i < columns.size(); i++) { String colName = (String) columns.get(i); Column column = getColumn(colName); result.append(column.getInlineSQL()); boolean hasNext = i < columns.size() - 1; if (hasNext) { result.append(",\n"); } if (column.hasDefferedConstraints()) { comment = "        -- referential constraint for " + column.getName() + " deffered due to circular dependencies"; if (hasNext) { result.append(comment); result.append("\n"); comment = null; } } }  boolean compoundDeffered = false;  for (Iterator it = m_constraints.iterator(); it.hasNext(); ) { Constraint con = (Constraint) it.next(); if (con.getColumns().length > 1) { if (con.isDeffered()) { compoundDeffered = true; } else { if (comment != null) { result.append(",\n"); result.append(comment); result.append("\n"); comment = null; } else { result.append(",\n"); } result.append(con.getSQL()); } } }  if (comment != null) { result.append("\n"); result.append(comment); comment = null; }  if (compoundDeffered) { result.append("\n    -- compound referential constraints " + "deffered due to circular dependencies"); }  result.append("\n);");  return result.toString();
return getSQL(true);
    public String getSQL() {        StringBuffer result = new StringBuffer();        List columns = new ArrayList();        columns.addAll(m_columns.keySet());        Collections.sort(columns);        for (int i = 0; i < columns.size(); i++) {            String colName = (String) columns.get(i);            Column col = getColumn(colName);            if (col.hasPrimaryKey()) {                columns.remove(i);                columns.add(0, colName);            }        }        result.append("create table " + getName() + " (\n");        String comment = null;        for (int i = 0; i < columns.size(); i++) {            String colName = (String) columns.get(i);            Column column = getColumn(colName);            result.append(column.getInlineSQL());            boolean hasNext = i < columns.size() - 1;            if (hasNext) {                result.append(",\n");            }            if (column.hasDefferedConstraints()) {                comment = "        -- referential constraint for " +                    column.getName() +                    " deffered due to circular dependencies";                if (hasNext) {                    result.append(comment);                    result.append("\n");                    comment = null;                }            }        }        boolean compoundDeffered = false;        for (Iterator it = m_constraints.iterator(); it.hasNext(); ) {            Constraint con = (Constraint) it.next();            if (con.getColumns().length > 1) {                if (con.isDeffered()) {                    compoundDeffered = true;                } else {                    if (comment != null) {                        result.append(",\n");                        result.append(comment);                        result.append("\n");                        comment = null;                    } else {                        result.append(",\n");                    }                    result.append(con.getSQL());                }            }        }        if (comment != null) {            result.append("\n");            result.append(comment);            comment = null;        }        if (compoundDeffered) {            result.append("\n    -- compound referential constraints " +                          "deffered due to circular dependencies");        }        result.append("\n);");        return result.toString();    }