@Override public boolean visit(SQLArrayDataType x) { print0(ucase ? "ARRAY<" : "array<"); x.getComponentType().accept(this); print('>'); return false; }
@Override public boolean visit(SQLStructDataType.Field x) { x.getName().accept(this); print(':'); x.getDataType().accept(this); print('>'); return false; }
public boolean visit(SQLCastExpr x) { print0(ucase ? "CAST(" : "cast("); x.getExpr().accept(this); print0(ucase ? " AS " : " as "); x.getDataType().accept(this); print0(")"); return false; }
@Override public boolean visit(PGTypeCastExpr x) { SQLExpr expr = x.getExpr(); SQLDataType dataType = x.getDataType(); if (dataType.nameHashCode64() == FnvHash.Constants.VARBIT) { dataType.accept(this); print(' '); printExpr(expr); return false; } if (expr != null) { if (expr instanceof SQLBinaryOpExpr) { print('('); expr.accept(this); print(')'); } else if (expr instanceof PGTypeCastExpr && dataType.getArguments().size() == 0) { dataType.accept(this); print('('); visit((PGTypeCastExpr) expr); print(')'); return false; } else { expr.accept(this); } } print0("::"); dataType.accept(this); return false; }
x.getReturnDataType().accept(this);
@Override public boolean visit(SQLColumnDefinition x) { boolean parameterized = this.parameterized; this.parameterized = false; x.getName().accept(this); if (x.getDataType() != null) { print(' '); x.getDataType().accept(this); } if (x.getDefaultExpr() != null) { visitColumnDefault(x); } for (SQLColumnConstraint item : x.getConstraints()) { print(' '); item.accept(this); } if (x.getIdentity() != null) { print(' '); x.getIdentity().accept(this); } if (x.getEnable() != null) { if (x.getEnable().booleanValue()) { print0(ucase ? " ENABLE" : " enable"); } } this.parameterized = parameterized; return false; }
print(' '); dataType.accept(this);
public boolean visit(OracleFunctionDataType x) { if (x.isStatic()) { print0(ucase ? "STATIC " : "static "); } print0(ucase ? "FUNCTION " : "function "); print0(x.getName()); print(" ("); printAndAccept(x.getParameters(), ", "); print(")"); print0(ucase ? " RETURN " : " return "); x.getReturnDataType().accept(this); SQLStatement block = x.getBlock(); if (block != null) { println(); print0(ucase ? "IS" : "is"); println(); block.accept(this); } return false; }
@Override public boolean visit(SQLAlterTableAlterColumn x) { boolean odps = isOdps(); if (odps) { print0(ucase ? "CHANGE COLUMN " : "change column "); } else { print0(ucase ? "ALTER COLUMN " : "alter column "); } x.getColumn().accept(this); if (x.isSetNotNull()) { // postgresql print0(ucase ? " SET NOT NULL" : " set not null"); } if (x.isDropNotNull()) { // postgresql print0(ucase ? " DROP NOT NULL" : " drop not null"); } if (x.getSetDefault() != null) { // postgresql print0(ucase ? " SET DEFAULT " : " set default "); x.getSetDefault().accept(this); } final SQLDataType dataType = x.getDataType(); if (dataType != null) { print0(ucase ? " SET DATA TYPE " : " set data type "); dataType.accept(this); } if (x.isDropDefault()) { // postgresql print0(ucase ? " DROP DEFAULT" : " drop default"); } return false; }
dataType.accept(this);
x.getDataType().accept(this);
x.getReturnDataType().accept(this);
if (dataType != null) { print(' '); dataType.accept(this);
@Override public boolean visit(SQLArrayDataType x) { print0(ucase ? "ARRAY<" : "array<"); x.getComponentType().accept(this); print('>'); return false; }
@Override public boolean visit(SQLStructDataType.Field x) { x.getName().accept(this); print(':'); x.getDataType().accept(this); print('>'); return false; }
public boolean visit(SQLCastExpr x) { print0(ucase ? "CAST(" : "cast("); x.getExpr().accept(this); print0(ucase ? " AS " : " as "); x.getDataType().accept(this); print0(")"); return false; }