当前位置: 首页>>代码示例>>Java>>正文


Java ExpressionList类代码示例

本文整理汇总了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;
}
 
开发者ID:Caratacus,项目名称:mybatis-plus-mini,代码行数:23,代码来源:JsqlParserUtils.java

示例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(", ");
        }
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:19,代码来源:InsertDeParser.java

示例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(")");
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:17,代码来源:ExpressionDeParser.java

示例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");
    }
}
 
开发者ID:baomidou,项目名称:mybatis-plus,代码行数:21,代码来源:TenantSqlParser.java

示例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");
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:22,代码来源:CCJSqlParser.java

示例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;
}
 
开发者ID:Hyperparticle,项目名称:integrity-coded-database,代码行数:17,代码来源:OCFQuery.java

示例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(", ");
            }
        }
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:17,代码来源:ReplaceDeParser.java

示例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(", ");
            }
        }
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:19,代码来源:InsertDeParser.java

示例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);
	}
}
 
开发者ID:sebastianoe,项目名称:s4j,代码行数:19,代码来源:FunctionProjector.java

示例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();
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:29,代码来源:ValuesList.java

示例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(")");
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:13,代码来源:ReplaceDeParser.java

示例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);
    }
}
 
开发者ID:devpage,项目名称:sharding-quickstart,代码行数:8,代码来源:TablesNamesFinder.java

示例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 + ")");
}
 
开发者ID:diennea,项目名称:herddb,代码行数:35,代码来源:CompiledInExpression.java

示例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);
    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:14,代码来源:JdbcQueryRewriter.java

示例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;
}
 
开发者ID:baomidou,项目名称:mybatis-plus,代码行数:20,代码来源:JsqlParserCountOptimize.java


注:本文中的net.sf.jsqlparser.expression.operators.relational.ExpressionList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。