@Override public String toString() { return (getComment() != null ? getComment() + " " : "") + getWholeColumnName(); }
public void visit(Column column) { buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()); }
public void visit(Column tableColumn) { buffer.append(tableColumn.getComment() != null ? tableColumn.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : ""); if (tableColumn.getTable().getName() != null) { String tableName = tableColumn.getTable().getWholeTableName(); buffer.append(tableName).append("."); } buffer.append(tableColumn.getColumnName()); }
public void deParse(Update aUpdate) { buffer.append(aUpdate.getComment() != null ? aUpdate.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Update ").append(ExpressionDeParser.LINE_SEPARATOR) .append(aUpdate.getTable().getComment() != null ? aUpdate.getTable().getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(aUpdate.getTable().getWholeTableName()).append(ExpressionDeParser.LINE_SEPARATOR) .append(aUpdate.getCommentSet() != null ? " " + aUpdate.getCommentSet() + ExpressionDeParser.LINE_SEPARATOR : "").append(" set "); int columnsCounter = 0; for (int i = 0, s = aUpdate.getColumns().size(); i < s; i++) { Column column = (Column) aUpdate.getColumns().get(i); buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()) .append(!aUpdate.getCommentsEqaulas().get(i).toString().isEmpty() ? " " + aUpdate.getCommentsEqaulas().get(i) + ExpressionDeParser.LINE_SEPARATOR : "").append(" = "); Expression expression = (Expression) aUpdate.getExpressions().get(i); expression.accept(expressionVisitor); if (i < aUpdate.getColumns().size() - 1) { buffer.append(!aUpdate.getCommentsComma().get(i).toString().isEmpty() ? " " + aUpdate.getCommentsComma().get(i) + " " : ""); if (columnsCounter++ == 2) { columnsCounter = 0; buffer.append(ExpressionDeParser.LINE_SEPARATOR).append(", "); } else { buffer.append(", "); } } } if (aUpdate.getWhere() != null) { buffer.append(aUpdate.getCommentWhere() != null ? " " + aUpdate.getCommentWhere() : "") .append(ExpressionDeParser.LINE_SEPARATOR).append(" Where "); aUpdate.getWhere().accept(expressionVisitor); } buffer.append(!"".equals(aUpdate.getEndComment()) ? " " + aUpdate.getEndComment() : ""); }
for (int i = 0; i < insert.getColumns().size(); i++) { Column column = (Column) insert.getColumns().get(i); buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()); buffer.append((i < insert.getColumns().size() - 1) ? (!"".equals(insert.getColumsComment().get(i)) ? " " + insert.getColumsComment().get(i) : "") : ""); if (i < insert.getColumns().size() - 1) {
for (int i = 0, s = aReplace.getColumns().size(); i < s; i++) { Column column = (Column) aReplace.getColumns().get(i); buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()) .append(!aReplace.getCommentEqlasColums().get(i).toString().isEmpty() ? " " + aReplace.getCommentEqlasColums().get(i) + ExpressionDeParser.LINE_SEPARATOR : "").append(" = "); Expression expression = (Expression) aReplace.getExpressions().get(i); for (int i = 0; i < aReplace.getColumns().size(); i++) { Column column = (Column) aReplace.getColumns().get(i); buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()); if (i < aReplace.getColumns().size() - 1) { buffer.append(!"".equals(aReplace.getCommentCommaColums().get(i)) ? " " + aReplace.getCommentCommaColums().get(i) + ExpressionDeParser.LINE_SEPARATOR : "")
for (int i = 0, s = join.getUsingColumns().size(); i < s; i++) { Column column = (Column) join.getUsingColumns().get(i); buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName()); if (i < join.getUsingColumns().size() - 1) { buffer.append(!join.getCommentComma().get(i).toString().isEmpty() ? " " + join.getCommentComma().get(i) + " " + ExpressionDeParser.LINE_SEPARATOR : "");