sql format support lcase

This commit is contained in:
高铁
2015-12-13 14:56:09 +08:00
parent de0715bd9c
commit 65cf8fa9a3
17 changed files with 699 additions and 646 deletions
@@ -42,32 +42,32 @@ public class DB2OutputVisitor extends SQLASTOutputVisitor implements DB2ASTVisit
SQLOrderBy orderBy= ((SQLSelect) parent).getOrderBy();
if (orderBy!=null&&orderBy.getItems().size() > 0) {
println();
print("ORDER BY ");
print0(ucase ? "ORDER BY " : "order by ");
printAndAccept(orderBy.getItems(), ", ");
((SQLSelect) parent).setOrderBy(null);
}
}
println();
print("FETCH FIRST ");
print0(ucase ? "FETCH FIRST " : "fetch first ");
x.getFirst().accept(this);
print(" ROWS ONLY");
print0(ucase ? " ROWS ONLY" : " rows only");
}
if (x.isForReadOnly()) {
println();
print("FOR READ ONLY");
print0(ucase ? "FOR READ ONLY" : "for read only");
}
if (x.getIsolation() != null) {
println();
print("WITH ");
print(x.getIsolation().name());
print0(ucase ? "WITH " : "with ");
print0(x.getIsolation().name());
}
if (x.getOptimizeFor() != null) {
println();
print("OPTIMIZE FOR ");
print0(ucase ? "OPTIMIZE FOR " : "optimize for ");
x.getOptimizeFor().accept(this);
}
@@ -82,7 +82,7 @@ public class DB2OutputVisitor extends SQLASTOutputVisitor implements DB2ASTVisit
@Override
public boolean visit(DB2ValuesStatement x) {
print("VALUES ");
print0(ucase ? "VALUES " : "values ");
x.getExpr().accept(this);
return false;
}