public Iterator sqlCommentStrings(Dialect dialect, String defaultCatalog, String defaultSchema) { List comments = new ArrayList(); if (dialect.supportsCommentOn()) { String tableName = getQualifiedName(dialect, defaultCatalog, defaultSchema); if (comment != null) { StringBuffer buf = new StringBuffer() .append("comment on table ") .append(tableName) .append(" is '") .append(comment) .append("'"); comments.add(buf.toString()); } Iterator iter = getColumnIterator(); while (iter.hasNext()) { Column column = (Column) iter.next(); String columnComment = column.getComment(); if (columnComment != null) { StringBuffer buf = new StringBuffer() .append("comment on column ") .append(tableName) .append('.') .append(column.getQuotedName(dialect)) .append(" is '") .append(columnComment) .append("'"); comments.add(buf.toString()); } } } return comments.iterator(); }
public Iterator sqlCommentStrings(Dialect dialect, String defaultCatalog, String defaultSchema) { List comments = new ArrayList(); if (dialect.supportsCommentOn()) { String tableName = getQualifiedName(dialect, defaultCatalog, defaultSchema); if (comment != null) { comments.add("comment on table " + tableName + " is '" + comment + "'"); } Iterator iter = getColumnIterator(); while (iter.hasNext()) { Column column = (Column) iter.next(); String columnComment = column.getComment(); if (columnComment != null) { comments.add( "comment on column " + tableName + '.' + column.getQuotedName(dialect) + " is '" + columnComment + "'"); } } } return comments.iterator(); }