use of com.alibaba.druid.sql.ast.SQLExpr in project druid by alibaba.
the class SQLSelectBuilderImpl method selectWithAlias.
@Override
public SQLSelectBuilderImpl selectWithAlias(String column, String alias) {
SQLSelectQueryBlock queryBlock = getQueryBlock();
SQLExpr columnExpr = SQLUtils.toSQLExpr(column, dbType);
SQLSelectItem selectItem = new SQLSelectItem(columnExpr, alias);
queryBlock.addSelectItem(selectItem);
return this;
}
use of com.alibaba.druid.sql.ast.SQLExpr in project druid by alibaba.
the class SQLUpdateBuilderImpl method where.
@Override
public SQLUpdateBuilderImpl where(String expr) {
SQLUpdateStatement update = getSQLUpdateStatement();
SQLExpr exprObj = SQLUtils.toSQLExpr(expr, dbType);
update.setWhere(exprObj);
return this;
}
use of com.alibaba.druid.sql.ast.SQLExpr in project druid by alibaba.
the class SQLUpdateBuilderImpl method setValue.
public SQLUpdateBuilderImpl setValue(String column, Object value) {
SQLUpdateStatement update = getSQLUpdateStatement();
SQLExpr columnExpr = SQLUtils.toSQLExpr(column, dbType);
SQLExpr valueExpr = toSQLExpr(value, dbType);
SQLUpdateSetItem item = new SQLUpdateSetItem();
item.setColumn(columnExpr);
item.setValue(valueExpr);
update.addItem(item);
return this;
}
use of com.alibaba.druid.sql.ast.SQLExpr in project druid by alibaba.
the class SQLUpdateBuilderImpl method whereAnd.
@Override
public SQLUpdateBuilderImpl whereAnd(String expr) {
SQLUpdateStatement update = getSQLUpdateStatement();
SQLExpr exprObj = SQLUtils.toSQLExpr(expr, dbType);
SQLExpr newCondition = SQLUtils.buildCondition(SQLBinaryOperator.BooleanAnd, exprObj, false, update.getWhere());
update.setWhere(newCondition);
return this;
}
use of com.alibaba.druid.sql.ast.SQLExpr in project druid by alibaba.
the class OracleSelectParser method parseInto.
protected void parseInto(OracleSelectQueryBlock x) {
if (lexer.token() == Token.INTO) {
lexer.nextToken();
SQLExpr expr = expr();
if (lexer.token() != Token.COMMA) {
x.setInto(expr);
return;
}
SQLListExpr list = new SQLListExpr();
list.addItem(expr);
while (lexer.token() == Token.COMMA) {
lexer.nextToken();
list.addItem(expr());
}
x.setInto(list);
}
}
Aggregations