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


Java ItemsList类代码示例

本文整理汇总了Java中net.sf.jsqlparser.expression.operators.relational.ItemsList的典型用法代码示例。如果您正苦于以下问题:Java ItemsList类的具体用法?Java ItemsList怎么用?Java ItemsList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ItemsList类属于net.sf.jsqlparser.expression.operators.relational包,在下文中一共展示了ItemsList类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseExpression

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
protected Set<String> parseExpression(Expression expression) {
	Set<String> expTableSet = new HashSet<String>();
	if (expression instanceof BinaryExpression) {
		expTableSet.addAll(parseExpression(((BinaryExpression)expression).getLeftExpression()));
		expTableSet.addAll(parseExpression(((BinaryExpression)expression).getRightExpression()));
	}
	
	if (expression instanceof InExpression) {
		ItemsList itemList = ((InExpression)expression).getRightItemsList();
		if (itemList instanceof SubSelect) {
			SubSelect subSelect = (SubSelect)itemList;
			expTableSet.addAll(parse(subSelect.getSelectBody()));
		}
	}
	
	return expTableSet;
}
 
开发者ID:PinaeOS,项目名称:timon,代码行数:18,代码来源:SelectParser.java

示例2: InExpression

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
final public Expression InExpression() throws ParseException {
      InExpression result = new InExpression();
      ItemsList itemsList = null;
      Expression leftExpression = null;
  leftExpression = SimpleExpression();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case K_NOT:
    jj_consume_token(K_NOT);
             result.setNot(true);
    break;
  default:
    jj_la1[87] = jj_gen;
    ;
  }
  jj_consume_token(K_IN);
  itemsList = ItemList();
              result.setLeftExpression(leftExpression);
              result.setItemsList(itemsList);
              {if (true) return result;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:22,代码来源:CCJSqlParser.java

示例3: parseConvertedQuery

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的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

示例4: createInsertMutation

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
private Mutation createInsertMutation(Insert insert, boolean generateParameterMetaData) throws SQLException
{
	ItemsList items = insert.getItemsList();
	if (generateParameterMetaData && items == null && insert.getSelect() != null)
	{
		// Just initialize the parameter meta data of the select statement
		createSelectBuilder(insert.getSelect(), insert.getSelect().toString());
		return null;
	}
	if (!(items instanceof ExpressionList))
	{
		throw new CloudSpannerSQLException("Insert statement must specify a list of values", Code.INVALID_ARGUMENT);
	}
	if (insert.getColumns() == null || insert.getColumns().isEmpty())
	{
		throw new CloudSpannerSQLException("Insert statement must specify a list of column names",
				Code.INVALID_ARGUMENT);
	}
	List<Expression> expressions = ((ExpressionList) items).getExpressions();
	String table = unquoteIdentifier(insert.getTable().getFullyQualifiedName());
	getParameterStore().setTable(table);
	WriteBuilder builder;
	if (insert.isUseDuplicate())
	{
		/**
		 * Do an insert-or-update. BUT: Cloud Spanner does not support
		 * supplying different values for the insert and update statements,
		 * meaning that only the values specified in the INSERT part of the
		 * statement will be considered. Anything specified in the 'ON
		 * DUPLICATE KEY UPDATE ...' statement will be ignored.
		 */
		if (this.forceUpdate)
			builder = Mutation.newUpdateBuilder(table);
		else
			builder = Mutation.newInsertOrUpdateBuilder(table);
	}
	else
	{
		/**
		 * Just do an insert and throw an error if a row with the specified
		 * key alread exists.
		 */
		builder = Mutation.newInsertBuilder(table);
	}
	int index = 0;
	for (Column col : insert.getColumns())
	{
		String columnName = unquoteIdentifier(col.getFullyQualifiedName());
		expressions.get(index).accept(new ValueBinderExpressionVisitorAdapter<>(getParameterStore(),
				builder.set(columnName), columnName));
		index++;
	}
	return builder.build();
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:55,代码来源:CloudSpannerPreparedStatement.java

示例5: setItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
public void setItemsList(ItemsList list) {
    itemsList = list;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:4,代码来源:Insert.java

示例6: setItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
public void setItemsList(ItemsList list) {
	itemsList = list;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:4,代码来源:Replace.java

示例7: visit

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
@Override
public synchronized void visit(Insert ins) {
   controlEventMap.put(sql, ControlEvent.INSERT);
   targetMap.put(sql, ins.getTable().getName());
   findPrimaryKeyColumn();

   List<SqlParameter> paramList = new ArrayList<SqlParameter>();
   parameterMap.put(sql, paramList);
   List<SqlParameter> updList = new ArrayList<SqlParameter>();
   insUpdColumnsMap.put(sql, updList);

   ItemsList il = ins.getItemsList();
   if (il instanceof ExpressionList) {
      ExpressionList el = (ExpressionList) il;

      if (ins.getColumns() != null
            && ins.getColumns().size() != el.getExpressions().size()) {
         String err = "Failed to parse INSERT statement "
               + sql
               + ": number of columns is not equal to number of values in VALUES clause";
         log.error(err);
         throw new CibetJdbcException(err);
      }

      int sequence = 0;
      for (int i = 0; i < el.getExpressions().size(); i++) {
         Expression exp = (Expression) el.getExpressions().get(i);
         SqlExpressionParser expParser = new SqlExpressionParser();
         exp.accept(expParser);
         Object value = expParser.getValue();
         String columnName = ins.getColumns() == null ? "?" + (i + 1)
               : ((Column) ins.getColumns().get(i)).getColumnName();

         SqlParameter sqlParam = new SqlParameter(columnName, value);
         if ("?".equals(value)) {
            sequence++;
            sqlParam.setSequence(sequence);
         }
         if (sqlParam.getColumn().equalsIgnoreCase(primaryKeyColumn)) {
            primaryKeys.put(sql, sqlParam);
         }
         paramList.add(sqlParam);
         updList.add(sqlParam);
      }

      refineColumnNames();

      if (primaryKeys.get(sql) == null) {
         emptyPrimaryKey(SqlParameterType.INSERT_PARAMETER);
      }

   } else {
      log.warn("Subselects not supported in statement " + sql);
      controlEventMap.put(sql, null);
   }
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:57,代码来源:SqlParser.java

示例8: ItemList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
final public ItemsList ItemList() throws ParseException {
      ItemsList itemsList = null;
      Table table = null;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 80:
    jj_consume_token(80);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_KEY:
    case K_NOT:
    case K_END:
    case K_NULL:
    case K_CASE:
    case K_BEGIN:
    case K_SELECT:
    case K_EXISTS:
    case K_REPLACE:
    case K_CAST:
    case S_DOUBLE:
    case S_INTEGER:
    case S_IDENTIFIER:
    case S_CHAR_LITERAL:
    case S_QUOTED_IDENTIFIER:
    case 80:
    case 84:
    case 96:
    case 97:
    case 100:
    case 102:
    case 103:
    case 104:
      if (jj_2_19(2147483647)) {
        itemsList = SubSelect();
      } else if (jj_2_20(2147483647)) {
        itemsList = ExpressionList();
      } else {
        jj_consume_token(-1);
        throw new ParseException();
      }
      break;
    default:
      jj_la1[85] = jj_gen;
      ;
    }
    jj_consume_token(81);
    break;
  default:
    jj_la1[86] = jj_gen;
    if (jj_2_21(2147483647)) {
      table = Table();
              // Encode `x IN tableName` as `x in (SELECT * FROM tableName)`
                      SubSelect subSel = new SubSelect();
                      PlainSelect body = new PlainSelect();
                      subSel.setAlias(table.getName());
                      subSel.setSelectBody(body);
                      body.setFromItem(table);
                      body.setSelectItems(Arrays.asList(
                              new AllColumns()
                      ));
                      itemsList = subSel;
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
  }
          {if (true) return itemsList;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:68,代码来源:CCJSqlParser.java

示例9: InExpression

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
final public Expression InExpression() throws ParseException {InExpression result = new InExpression();
        ItemsList itemsList = null;
        Expression leftExpression = null;
        Token tk = null;
        String commentBeginBrakcet = null;
        String commentEndBrakcet = null;
        SubSelect subSel = null;
        List commentComma = new ArrayList();
    leftExpression = SimpleExpression();
    switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    case K_NOT:{
      tk = jj_consume_token(K_NOT);
if (tk.specialToken != null) {
      result.setCommentNot(tk.specialToken.image);
     }
        result.setNot(true);
      break;
      }
    default:
      jj_la1[100] = jj_gen;
      ;
    }
    tk = jj_consume_token(K_IN);
if (tk.specialToken != null) {
      result.setCommentIn(tk.specialToken.image);
     }
    tk = jj_consume_token(LPAREN);
if (tk.specialToken != null) {
      commentBeginBrakcet=tk.specialToken.image;
     }
    if (jj_2_19(2147483647)) {
      subSel = SubSelect();
subSel.setCommentBeginBracket(commentBeginBrakcet);
    } else {
      switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
      case K_NULL:
      case K_CASE:
      case K_REPLACE:
      case S_DOUBLE:
      case S_INTEGER:
      case S_IDENTIFIER:
      case S_CHAR_LITERAL:
      case S_QUOTED_IDENTIFIER:
      case LPAREN:
      case HOOK:
      case ADD:
      case MINUS:
      case COLON:
      case DATELITERAL:
      case TIMELITERAL:
      case TIMESTAMPLITERAL:
      case ESCAPEDLITEARL:{
        itemsList = SimpleExpressionList();
        break;
        }
      default:
        jj_la1[101] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
    tk = jj_consume_token(RPAREN);
if (tk.specialToken != null) {
      commentEndBrakcet=tk.specialToken.image;
     }
         if (subSel != null) {
          subSel.setCommentEndBracket(commentEndBrakcet);
          itemsList = subSel;
         } else {
          result.setCommentBeginBracket(commentBeginBrakcet);
          ((ExpressionList) itemsList).setCommentEndBracket(commentEndBrakcet);}
result.setLeftExpression(leftExpression);
                result.setItemsList(itemsList);
                {if ("" != null) return result;}
    throw new Error("Missing return statement in function");
  }
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:77,代码来源:CCJSqlParser.java

示例10: getItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
/**
 * Get the values (as VALUES (...) or SELECT)
 *
 * @return the values of the insert
 */
public ItemsList getItemsList() {
    return itemsList;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:9,代码来源:Insert.java

示例11: getItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
/**
 * An {@link ItemsList} (either from a "REPLACE mytab VALUES (exp1,exp2)" or
 * a "REPLACE mytab SELECT * FROM mytab2") it is null in case of a "REPLACE
 * mytab SET col1=exp1, col2=exp2"
 */
public ItemsList getItemsList() {
	return itemsList;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:9,代码来源:Replace.java

示例12: getItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
/**
 * Get the values (as VALUES (...) or SELECT) 
 * @return the values of the insert
 */
public ItemsList getItemsList() {
	return itemsList;
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:8,代码来源:Insert.java

示例13: getItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
/**
 * An {@link ItemsList} (either from a "REPLACE mytab VALUES (exp1,exp2)" or a "REPLACE mytab SELECT * FROM mytab2")  
 * it is null in case of a "REPLACE mytab SET col1=exp1, col2=exp2"
 * @return The target relation
 */
public ItemsList getItemsList() {
	return itemsList;
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:9,代码来源:Replace.java

示例14: getItemsList

import net.sf.jsqlparser.expression.operators.relational.ItemsList; //导入依赖的package包/类
/**
 * An {@link ItemsList} (either from a "REPLACE mytab VALUES (exp1,exp2)" or
 * a "REPLACE mytab SELECT * FROM mytab2") it is null in case of a "REPLACE
 * mytab SET col1=exp1, col2=exp2"
 */
public ItemsList getItemsList() {
    return itemsList;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:Replace.java


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