net.sf.jsqlparser.statement.select.Select.getWithItemsList()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(403)

本文整理了Java中net.sf.jsqlparser.statement.select.Select.getWithItemsList()方法的一些代码示例,展示了Select.getWithItemsList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Select.getWithItemsList()方法的具体详情如下:
包路径:net.sf.jsqlparser.statement.select.Select
类名称:Select
方法名:getWithItemsList

Select.getWithItemsList介绍

暂无

代码示例

代码示例来源:origin: JSQLParser/JSqlParser

@Override
public void visit(Select select) {
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) {
      withItem.accept(this);
    }
  }
  select.getSelectBody().accept(this);
}

代码示例来源:origin: alibaba/mdrill

public void visit(Select select) {
  SelectDeParser selectDeParser = new SelectDeParser();
  selectDeParser.setBuffer(buffer);
  ExpressionDeParser expressionDeParser = new ExpressionDeParser(selectDeParser, buffer);
  selectDeParser.setExpressionVisitor(expressionDeParser);
  if (select.getWithItemsList() != null && !select.getWithItemsList().isEmpty()) {
    buffer.append("WITH ");
    for (Iterator iter = select.getWithItemsList().iterator(); iter.hasNext();) {
      WithItem withItem = (WithItem)iter.next();
      buffer.append(withItem);
      if (iter.hasNext())
        buffer.append(",");
      buffer.append(" ");
    }
  }
  select.getSelectBody().accept(selectDeParser);
}

代码示例来源:origin: JSQLParser/JSqlParser

@Override
public void visit(Select select) {
  selectDeParser.setBuffer(buffer);
  expressionDeParser.setSelectVisitor(selectDeParser);
  expressionDeParser.setBuffer(buffer);
  selectDeParser.setExpressionVisitor(expressionDeParser);
  if (select.getWithItemsList() != null && !select.getWithItemsList().isEmpty()) {
    buffer.append("WITH ");
    for (Iterator<WithItem> iter = select.getWithItemsList().iterator(); iter.hasNext();) {
      WithItem withItem = iter.next();
      withItem.accept(selectDeParser);
      if (iter.hasNext()) {
        buffer.append(",");
      }
      buffer.append(" ");
    }
  }
  select.getSelectBody().accept(selectDeParser);
}

代码示例来源:origin: JSQLParser/JSqlParser

private void appendSelect(Upsert upsert) {
  buffer.append(" ");
  if (upsert.isUseSelectBrackets()) {
    buffer.append("(");
  }
  if (upsert.getSelect().getWithItemsList() != null) {
    buffer.append("WITH ");
    for (WithItem with : upsert.getSelect().getWithItemsList()) {
      with.accept(selectVisitor);
    }
    buffer.append(" ");
  }
  upsert.getSelect().getSelectBody().accept(selectVisitor);
  if (upsert.isUseSelectBrackets()) {
    buffer.append(")");
  }
}

代码示例来源:origin: JSQLParser/JSqlParser

if (select.getWithItemsList() != null) {
  buffer.append("WITH ");
  boolean first = true;
  for (WithItem item : select.getWithItemsList()) {
    if (!first) {
      buffer.append(", ");

代码示例来源:origin: JSQLParser/JSqlParser

buffer.append("(");
if (insert.getSelect().getWithItemsList() != null) {
  buffer.append("WITH ");
  for (WithItem with : insert.getSelect().getWithItemsList()) {
    with.accept(selectVisitor);

代码示例来源:origin: pagehelper/Mybatis-PageHelper

processWithItemsList(select.getWithItemsList());

代码示例来源:origin: pagehelper/Mybatis-PageHelper

if (isNotEmptyList(select.getWithItemsList())) {
  newSelect.setWithItemsList(select.getWithItemsList());

代码示例来源:origin: com.github.jsqlparser/jsqlparser

@Override
public void visit(Select select) {
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) {
      withItem.accept(this);
    }
  }
  select.getSelectBody().accept(this);
}

代码示例来源:origin: ontop/ontop

/**
 * Main entry for this Tool class. A list of found tables is returned.
 *
 * @param select
 */
public TableNameVisitor(Select select, QuotedIDFactory idfac) throws JSQLParserException {
  this.idfac = idfac;
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList())
      withItem.accept(selectVisitor);
  }
  select.getSelectBody().accept(selectVisitor);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-mapping-sql-core

/**
 * Main entry for this Tool class. A list of found tables is returned.
 *
 * @param select
 */
public TableNameVisitor(Select select, QuotedIDFactory idfac) throws JSQLParserException {
  this.idfac = idfac;
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList())
      withItem.accept(selectVisitor);
  }
  select.getSelectBody().accept(selectVisitor);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * Return a {@link AggregationJSQL} containing GROUP BY statement
 * @param select 
 * @return
 */
public AggregationJSQL getAggregation(Select select, boolean deepParsing){
  
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) {
      withItem.accept(this);
    }
  }
  select.getSelectBody().accept(this);
  return aggregation;
  
}

代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat

public void visit(Select select) {
  SelectDeParser selectDeParser = new SelectDeParser();
  selectDeParser.setBuffer(buffer);
  ExpressionDeParser expressionDeParser = new ExpressionDeParser(selectDeParser, buffer);
  selectDeParser.setExpressionVisitor(expressionDeParser);
  if (select.getWithItemsList() != null && !select.getWithItemsList().isEmpty()) {
    buffer.append("WITH ");
    for (Iterator iter = select.getWithItemsList().iterator(); iter.hasNext();) {
      WithItem withItem = (WithItem)iter.next();
      buffer.append(withItem);
      if (iter.hasNext())
        buffer.append(",");
      buffer.append(" ");
    }
  }
  select.getSelectBody().accept(selectDeParser);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * Return the list of columns with the expressions between SELECT and FROM, 
 * considering also the case of UNION
 * 
 * @param select parsed statement
 * @return
 */

public ColumnsVisitor(Select select) {	
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) {
      withItem.accept(this);
    }
  }
  select.getSelectBody().accept(this);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * NORMALISES EXPRESSION ALIAS NAMES in SELECT clauses (including subqueries)
 * 
 * @param select
 * @param idfac
 */

public AliasMapVisitor(Select select, QuotedIDFactory idfac) {
  this.idfac = idfac;
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) {
      withItem.accept(selectVisitor);
    }
  }
  
  select.getSelectBody().accept(selectVisitor);
}

代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser

public void visit(Select select) {
  SelectDeParser selectDeParser = new SelectDeParser();
  selectDeParser.setBuffer(buffer);
  ExpressionDeParser expressionDeParser = new ExpressionDeParser(selectDeParser, buffer);
  selectDeParser.setExpressionVisitor(expressionDeParser);
  if (select.getWithItemsList() != null && !select.getWithItemsList().isEmpty()) {
    buffer.append(select.getCommentWith() != null ? select.getCommentWith()+" " : "").append(ExpressionDeParser.LINE_SEPARATOR).append("With ");
    
    for (int i = 0; i <  select.getWithItemsList().size(); i++) {
     WithItem withItem = (WithItem) select.getWithItemsList().get(i);
     buffer.append(withItem);
     buffer.append((i < select.getWithItemsList().size() - 1) ? (!"".equals(select.getCommentsComma().get(i)) ? " " + select.getCommentsComma().get(i)+ExpressionDeParser.LINE_SEPARATOR:"")+ "," : "")
     .append(ExpressionDeParser.LINE_SEPARATOR).append(" ");
    }
  }
  select.getSelectBody().accept(selectDeParser);
  buffer.append(!"".equals(select.getEndComment()) ? " "+select.getEndComment() : "");
}

代码示例来源:origin: diennea/herddb

@Override
public void visit(Select select) {
  if (select.getSelectBody() != null) {
    select.getSelectBody().accept(this);
  }
  if (select.getWithItemsList() != null) {
    select.getWithItemsList().forEach(
      i -> {
        if (i != null) {
          i.accept(this);
        }
      }
    );
  }
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * Main entry for this Tool class. A list of found tables is returned.
 *
 * @param select
 * @param deepParsing
 * @return
 */
public TableNameVisitor(Select select, boolean deepParsing, QuotedIDFactory idfac) throws JSQLParserException {
  this.idfac = idfac;
  
   if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) 
      withItem.accept(selectVisitor);
  }
  select.getSelectBody().accept(selectVisitor);
  
  if (unsupported && deepParsing) // used to throw exception for the currently unsupported methods
    throw new JSQLParserException(SQLQueryDeepParser.QUERY_NOT_SUPPORTED);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * Give the WHERE clause of the SELECT statement<br>
 * 
 * NOTE: is also BRINGS ALL SCHEMA / TABLE / ALIAS / COLUMN NAMES in the WHERE clause into NORMAL FORM
 * 
 * @param select the parsed select statement
 * @return an Expression
 * @throws JSQLParserException 
 */
public Expression getWhereClause(Select select, boolean deepParsing) throws JSQLParserException {
  
  if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) 
      withItem.accept(selectVisitor);
  }
  
  select.getSelectBody().accept(selectVisitor);
  
  if (unsupported && deepParsing)
      throw new JSQLParserException(SQLQueryDeepParser.QUERY_NOT_SUPPORTED);
  
  return whereClause;
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

/**
 * Method to substitute * from the select query. It add the columns name that are used in the mapping
 * @param select the query with or without *
 * @param variables the variables used in the mapping, this are the needed columns for our select query
 * @return  the query with columns or functions in the projection part
 */
public String getMappingQuery(Select select, Set<Variable> variables) {
  VariableSet variableNames = new VariableSet(variables);
  
   if (select.getWithItemsList() != null) {
    for (WithItem withItem : select.getWithItemsList()) 
      withItem.accept(new ReplaceStarSelectVisitor(false, null, variableNames));
  }
  select.getSelectBody().accept(new ReplaceStarSelectVisitor(false, null, variableNames));
  return select.toString();
}

相关文章