本文整理汇总了Java中net.sf.jsqlparser.expression.operators.relational.ExpressionList类的典型用法代码示例。如果您正苦于以下问题:Java ExpressionList类的具体用法?Java ExpressionList怎么用?Java ExpressionList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionList类属于net.sf.jsqlparser.expression.operators.relational包,在下文中一共展示了ExpressionList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: countSelectItem
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
/**
* 获取jsqlparser中count的SelectItem
*
* @return
*/
private static List<SelectItem> countSelectItem() {
if (CollectionUtils.isNotEmpty(countSelectItem)) {
return countSelectItem;
}
Function function = new Function();
function.setName("COUNT");
List<Expression> expressions = new ArrayList<>();
LongValue longValue = new LongValue(1);
ExpressionList expressionList = new ExpressionList();
expressions.add(longValue);
expressionList.setExpressions(expressions);
function.setParameters(expressionList);
countSelectItem = new ArrayList<>();
SelectExpressionItem selectExpressionItem = new SelectExpressionItem(function);
countSelectItem.add(selectExpressionItem);
return countSelectItem;
}
示例2: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public void visit(MultiExpressionList multiExprList) {
buffer.append(" VALUES ");
for (Iterator<ExpressionList> it = multiExprList.getExprList().iterator(); it.hasNext();) {
buffer.append("(");
for (Iterator<Expression> iter = it.next().getExpressions().iterator(); iter.hasNext();) {
Expression expression = iter.next();
expression.accept(expressionVisitor);
if (iter.hasNext()) {
buffer.append(", ");
}
}
buffer.append(")");
if (it.hasNext()) {
buffer.append(", ");
}
}
}
示例3: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public void visit(ExpressionList expressionList) {
if (useBracketsInExprList) {
buffer.append("(");
}
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext();) {
Expression expression = iter.next();
expression.accept(this);
if (iter.hasNext()) {
buffer.append(", ");
}
}
if (useBracketsInExprList) {
buffer.append(")");
}
}
示例4: processInsert
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
/**
* <p>
* insert 语句处理
* </p>
*/
@Override
public void processInsert(Insert insert) {
if (this.tenantHandler.doTableFilter(insert.getTable().getName())) {
// 过滤退出执行
return;
}
insert.getColumns().add(new Column(this.tenantHandler.getTenantIdColumn()));
if (insert.getSelect() != null) {
processPlainSelect((PlainSelect) insert.getSelect().getSelectBody(), true);
} else if (insert.getItemsList() != null) {
((ExpressionList) insert.getItemsList()).getExpressions().add(tenantHandler.getTenantId());
} else {
throw new MybatisPlusException("Failed to process multiple-table update, please exclude the tableName or statementId");
}
}
示例5: ExpressionList
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
final public ExpressionList ExpressionList() throws ParseException {
ExpressionList retval = new ExpressionList();
List expressions = new ArrayList();
Expression expr = null;
expr = Expression();
expressions.add(expr);
label_18:
while (true) {
if (jj_2_22(2147483647)) {
;
} else {
break label_18;
}
jj_consume_token(79);
expr = Expression();
expressions.add(expr);
}
retval.setExpressions(expressions);
{if (true) return retval;}
throw new Error("Missing return statement in function");
}
示例6: parseConvertedQuery
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
protected Statement parseConvertedQuery(Insert insert) {
// Get expression list from query
ItemsList itemsList = insert.getItemsList();
if (itemsList instanceof MultiExpressionList) {
((MultiExpressionList) itemsList).getExprList().stream()
.map(ExpressionList::getExpressions)
.forEach(this::convertExpressionList);
} else {
List<Expression> expressions = ((ExpressionList) itemsList).getExpressions();
convertExpressionList(expressions);
}
return insert;
}
示例7: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
public void visit(ExpressionList expressionList) {
buffer.append(ExpressionDeParser.LINE_SEPARATOR).append("(");
int valuesCounter = 0;
for (Iterator iter = expressionList.getExpressions().iterator(); iter.hasNext();) {
Expression expression = (Expression) iter.next();
expression.accept(expressionVisitor);
if (iter.hasNext()) {
if (valuesCounter++ == 2) {
valuesCounter = 0;
buffer.append(ExpressionDeParser.LINE_SEPARATOR).append(", ");
} else {
buffer.append(", ");
}
}
}
}
示例8: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
public void visit(ExpressionList expressionList) {
buffer.append("(");
int valuesCounter = 0;
for (int i = 0; i < expressionList.getExpressions().size(); i++) {
Expression expression = (Expression) expressionList.getExpressions().get(i);
expression.accept(expressionVisitor);
buffer.append((i < expressionList.getExpressions().size() - 1) ? (!"".equals(expressionList.getCommentsComma().get(i)) ? " "
+ expressionList.getCommentsComma().get(i) + ExpressionDeParser.LINE_SEPARATOR : "") : "");
if (i < expressionList.getExpressions().size() - 1) {
if (valuesCounter++ == 2) {
valuesCounter = 0;
buffer.append(ExpressionDeParser.LINE_SEPARATOR).append(", ");
} else {
buffer.append(", ");
}
}
}
}
示例9: getFunctionResultType
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
private String getFunctionResultType(List<ProjectionItem> fromProjections) throws AmbiguousCoalesceException {
if (function.isAllColumns()) {
return determineFunctionType(null);
} else {
List<String> paramsTypes = Lists.newArrayList();
ExpressionList functionParams = function.getParameters();
if (functionParams != null) {
List<Expression> params = functionParams.getExpressions();
for (Expression param : params) {
paramsTypes.add(getTypeFromSubExpression(param, fromProjections));
}
}
return determineFunctionType(paramsTypes);
}
}
示例10: toString
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("(VALUES ");
for (Iterator<ExpressionList> it = getMultiExpressionList().getExprList().iterator(); it.hasNext();) {
b.append(PlainSelect.getStringList(it.next().getExpressions(), true, !isNoBrackets()));
if (it.hasNext()) {
b.append(", ");
}
}
b.append(")");
if (alias != null) {
b.append(alias.toString());
if (columnNames != null) {
b.append("(");
for (Iterator<String> it = columnNames.iterator(); it.hasNext();) {
b.append(it.next());
if (it.hasNext()) {
b.append(", ");
}
}
b.append(")");
}
}
return b.toString();
}
示例11: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public void visit(ExpressionList expressionList) {
buffer.append(" VALUES (");
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext();) {
Expression expression = iter.next();
expression.accept(expressionVisitor);
if (iter.hasNext()) {
buffer.append(", ");
}
}
buffer.append(")");
}
示例12: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public void visit(ExpressionList expressionList) {
for (Iterator<?> iter = expressionList.getExpressions().iterator();iter.hasNext();) {
Expression expression = (Expression) iter.next();
expression.accept(this);
}
}
示例13: create
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
public static CompiledInExpression create(InExpression in, String validatedTableAlias) {
if (in.getLeftItemsList() != null) {
throw new StatementExecutionException("Unsupported operand " + in.getClass() + " with a non-expression left argument (" + in + ")");
}
CompiledSQLExpression left = compileExpression(validatedTableAlias, in.getLeftExpression());
if (left == null) {
return null;
}
if (in.getRightItemsList() instanceof ExpressionList) {
List<CompiledSQLExpression> expList = new ArrayList<>();
ExpressionList exps = (ExpressionList) in.getRightItemsList();
for (Expression exp : exps.getExpressions()) {
CompiledSQLExpression newExp = compileExpression(validatedTableAlias, exp);
if (newExp == null) {
return null;
}
expList.add(newExp);
}
return new CompiledInExpression(in.isNot(), left, expList, null);
}
if (in.getRightItemsList() instanceof SubSelect) {
SubSelect ss = (SubSelect) in.getRightItemsList();
if (!(ss.getSelectBody() instanceof PlainSelect)) {
throw new StatementExecutionException("unsupported operand " + in.getClass()
+ " with subquery of type " + ss.getClass() + "(" + ss + ")");
}
return new CompiledInExpression(in.isNot(), left, null, ss);
}
throw new StatementExecutionException("unsupported operand " + in.getClass()
+ " with argument of type " + in.getRightItemsList().getClass() + "(" + in + ")");
}
示例14: visit
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
@Override
public void visit(ExpressionList expressionList) {
List<Expression> expressions = expressionList.getExpressions();
int size = expressions.size();
for (int i = 0; i < size; i++) {
Expression e = expressions.get(i);
if (e instanceof JdbcParameter) {
e = ImmutableExpressionsCache.internOrFixJdbcParameterExpression((JdbcParameter) e);
}
expressions.set(i, e);
e.accept(this);
}
}
示例15: countSelectItem
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; //导入依赖的package包/类
/**
* <p>
* 获取jsqlparser中count的SelectItem
* </p>
*/
private static List<SelectItem> countSelectItem() {
Function function = new Function();
function.setName("COUNT");
List<Expression> expressions = new ArrayList<>();
LongValue longValue = new LongValue(1);
ExpressionList expressionList = new ExpressionList();
expressions.add(longValue);
expressionList.setExpressions(expressions);
function.setParameters(expressionList);
List<SelectItem> selectItems = new ArrayList<>();
SelectExpressionItem selectExpressionItem = new SelectExpressionItem(function);
selectItems.add(selectExpressionItem);
return selectItems;
}