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


Java SetOperationList类代码示例

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


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

示例1: addExpression

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
/**
 * Adds an expression to select statements. E.g. a simple column is an
 * expression.
 *
 * @param select
 * @param expr
 */
public static void addExpression(Select select, final Expression expr) {
	select.getSelectBody().accept(new SelectVisitor() {

		@Override
		public void visit(PlainSelect plainSelect) {
			plainSelect.getSelectItems().add(new SelectExpressionItem(expr));
		}

		@Override
		public void visit(SetOperationList setOpList) {
			throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
		}

		@Override
		public void visit(WithItem withItem) {
			throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
		}
	});
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:27,代码来源:SelectUtils.java

示例2: addGroupBy

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
/**
   * Adds group by to a plain select statement.
   * @param select
   * @param expr 
   */
  public static void addGroupBy(Select select, final Expression expr) {
      select.getSelectBody().accept(new SelectVisitor() {

	@Override
	public void visit(PlainSelect plainSelect) {
              plainSelect.addGroupByColumnReference(expr);
	}

	@Override
	public void visit(SetOperationList setOpList) {
		throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
	}

	@Override
	public void visit(WithItem withItem) {
		throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
	}
});
  }
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:25,代码来源:SelectUtils.java

示例3: processSelectBody

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
/**
 * select 语句处理
 */
@Override
public void processSelectBody(SelectBody selectBody) {
    if (selectBody instanceof PlainSelect) {
        processPlainSelect((PlainSelect) selectBody);
    } else if (selectBody instanceof WithItem) {
        WithItem withItem = (WithItem) selectBody;
        if (withItem.getSelectBody() != null) {
            processSelectBody(withItem.getSelectBody());
        }
    } else {
        SetOperationList operationList = (SetOperationList) selectBody;
        if (operationList.getSelects() != null && operationList.getSelects().size() > 0) {
            List<SelectBody> plainSelects = operationList.getSelects();
            for (SelectBody plainSelect : plainSelects) {
                processSelectBody(plainSelect);
            }
        }
    }
}
 
开发者ID:baomidou,项目名称:mybatis-plus,代码行数:23,代码来源:TenantSqlParser.java

示例4: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList list) {
    for (int i = 0; i < list.getSelects().size(); i++) {
        if (i != 0) {
            buffer.append(' ').append(list.getOperations().get(i - 1)).append(' ');
        }
        boolean brackets = list.getBrackets() == null || list.getBrackets().get(i);
        if (brackets) {
            buffer.append("(");
        }
        list.getSelects().get(i).accept(this);
        if (brackets) {
            buffer.append(")");
        }
    }
    if (list.getOrderByElements() != null) {
        new OrderByDeParser(expressionVisitor, buffer).deParse(list.getOrderByElements());
    }

    if (list.getLimit() != null) {
        new LimitDeparser(buffer).deParse(list.getLimit());
    }
    if (list.getOffset() != null) {
        deparseOffset(list.getOffset());
    }
    if (list.getFetch() != null) {
        deparseFetch(list.getFetch());
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:30,代码来源:SelectDeParser.java

示例5: parse

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
public Set<String> parse(SelectBody selectBody) {
	
	Set<String> tableSet = new HashSet<String>();
	
	if (selectBody != null) {
		if (selectBody instanceof PlainSelect) {
			PlainSelect plainSelect = (PlainSelect) selectBody;
			tableSet.addAll(parseTable(plainSelect.getFromItem()));
			
			List<Join> joins = plainSelect.getJoins();
			if (joins != null) {
				for (Join join : joins) {
					tableSet.addAll(parseTable(join.getRightItem()));
				}
			}
			
			Expression expression = plainSelect.getWhere();
			if (expression != null) {
				tableSet.addAll(parseExpression(expression));
			}
		}

		if (selectBody instanceof SetOperationList) {
			SetOperationList setList = (SetOperationList) selectBody;
			for (SelectBody select : setList.getSelects()) {
				tableSet.addAll(parse(select));
			}
		}
		
	}
	return tableSet;
}
 
开发者ID:PinaeOS,项目名称:timon,代码行数:33,代码来源:SelectParser.java

示例6: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList sol) {
    if (sol.getOrderByElements() != null) {
        for (OrderByElement ob: sol.getOrderByElements()) {
            ob.accept(this);
        }
    }
    if (sol.getSelects() != null) {
        for (SelectBody ps: sol.getSelects()) {
            ps.accept(this);
        }
    }
}
 
开发者ID:valdasraps,项目名称:resthub,代码行数:14,代码来源:AbstractAllParser.java

示例7: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(Select select) {
    select.getSelectBody().accept(new SelectVisitor() {
        @Override
        public void visit(PlainSelect plainSelect) {
            commandBuilder.buildSelect(plainSelect);
        }

        @Override
        public void visit(SetOperationList setOperationList) {
        }
    });
}
 
开发者ID:mulesoft-labs,项目名称:mongo-sql-console,代码行数:14,代码来源:SQLStatementVisitor.java

示例8: SelectBody

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
final public SelectBody SelectBody() throws ParseException {
/* @bgen(jjtree) SelectBody */
      SimpleNode jjtn000 = new SimpleNode(JJTSELECTBODY);
      boolean jjtc000 = true;
      jjtree.openNodeScope(jjtn000);
      SelectBody selectBody = null;
      try {
          if (jj_2_19(2147483647)) {
              selectBody = SetOperationList();
          } else {
              switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                  case K_SELECT:
                      selectBody = PlainSelect();
                      break;
                  case 166:
                      jj_consume_token(166);
                      selectBody = PlainSelect();
                      ((PlainSelect) selectBody).setUseBrackets(true);
                      jj_consume_token(167);
                      break;
                  default:
                      jj_la1[69] = jj_gen;
                      jj_consume_token(-1);
                      throw new ParseException();
              }
          }
          jjtree.closeNodeScope(jjtn000, true);
          jjtc000 = false;
          {
              if (true)
                  return selectBody;
          }
      } catch (Throwable jjte000) {
          if (jjtc000) {
              jjtree.clearNodeScope(jjtn000);
              jjtc000 = false;
          } else {
              jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
              {
                  if (true)
                      throw (RuntimeException) jjte000;
              }
          }
          if (jjte000 instanceof ParseException) {
              {
                  if (true)
                      throw (ParseException) jjte000;
              }
          }
          {
              if (true)
                  throw (Error) jjte000;
          }
      } finally {
          if (jjtc000) {
              jjtree.closeNodeScope(jjtn000, true);
          }
      }
      throw new Error("Missing return statement in function");
  }
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:63,代码来源:CCJSqlParser.java

示例9: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList setOpList) {
	for (SelectBody select : setOpList.getSelects()) {
		select.accept(this);
	}
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:7,代码来源:AddAliasesVisitor.java

示例10: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList list) {
    for (SelectBody plainSelect : list.getSelects()) {
        plainSelect.accept(this);
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:7,代码来源:TablesNamesFinder.java

示例11: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList setOpList) {
    // TODO Auto-generated method stub
    
}
 
开发者ID:devpage,项目名称:sharding-quickstart,代码行数:6,代码来源:TablesNamesFinder.java

示例12: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList setOpList) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:diennea,项目名称:herddb,代码行数:5,代码来源:JdbcQueryRewriter.java

示例13: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
public void visit(SetOperationList setOpList) {
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:3,代码来源:TableFinder.java

示例14: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList arg0) {
	isSimple = false;
}
 
开发者ID:coastland,项目名称:gsp-dba-maven-plugin,代码行数:5,代码来源:ViewAnalyzer.java

示例15: visit

import net.sf.jsqlparser.statement.select.SetOperationList; //导入依赖的package包/类
@Override
public void visit(SetOperationList setOperationList)
{
   throw new UnsupportedSqlExpressionException("SET OPERATION LIST"); //$NON-NLS-1$
}
 
开发者ID:obidea,项目名称:semantika,代码行数:6,代码来源:SelectStatementHandler.java


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