本文整理汇总了Java中net.sf.jsqlparser.statement.select.PlainSelect.getWhere方法的典型用法代码示例。如果您正苦于以下问题:Java PlainSelect.getWhere方法的具体用法?Java PlainSelect.getWhere怎么用?Java PlainSelect.getWhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jsqlparser.statement.select.PlainSelect
的用法示例。
在下文中一共展示了PlainSelect.getWhere方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
if (plainSelect.getSelectItems() != null) {
for (SelectItem item : plainSelect.getSelectItems()) {
item.accept(this);
}
}
if (plainSelect.getFromItem() != null) {
plainSelect.getFromItem().accept(this);
}
if (plainSelect.getJoins() != null) {
for (Join join : plainSelect.getJoins()) {
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
if (plainSelect.getOracleHierarchical() != null) {
plainSelect.getOracleHierarchical().accept(this);
}
}
示例2: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
List<SelectItem> cols = plainSelect.getSelectItems();
for(SelectItem col : cols){
col.accept(this);
}
if(plainSelect.getFromItem()!=null){
plainSelect.getFromItem().accept(this);
}
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null)
plainSelect.getWhere().accept(this);
}
示例3: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
if (plainSelect.getFromItem() != null) {
plainSelect.getFromItem().accept(this);
}
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
}
示例4: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect ps) {
ps.getFromItem().accept(this);
if (ps.getJoins() != null) {
for (Join j : ps.getJoins()) {
j.getRightItem().accept(this);
}
}
if (ps.getWhere() != null) {
ps.getWhere().accept(this);
}
if (ps.getOracleHierarchical() != null) {
ps.getOracleHierarchical().accept(this);
}
}
示例5: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins()!=null) {
for(Iterator<?> joinsIt = plainSelect.getJoins().iterator();joinsIt.hasNext();){
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
}
示例6: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
if (plainSelect.getDistinct() != null && plainSelect.getDistinct().getOnSelectItems() != null) {
plainSelect.getDistinct().getOnSelectItems().forEach(s -> s.accept(this));
}
if (plainSelect.getFromItem() != null) {
plainSelect.getFromItem().accept(this);
}
if (plainSelect.getGroupByColumnReferences() != null) {
plainSelect.getGroupByColumnReferences().forEach(s -> s.accept(this));
}
if (plainSelect.getHaving() != null) {
plainSelect.getHaving().accept(this);
}
if (plainSelect.getJoins() != null) {
plainSelect.getJoins().forEach(
j -> {
visitJoin(j);
}
);
}
if (plainSelect.getOrderByElements() != null) {
plainSelect.getOrderByElements().forEach(s -> s.accept(this));
}
if (plainSelect.getSelectItems() != null) {
plainSelect.getSelectItems().forEach(s -> s.accept(this));
}
if (plainSelect.getTop() != null) {
plainSelect.getTop().getExpression().accept(this);
}
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
if (plainSelect.getLimit() != null) {
visitLimit(plainSelect.getLimit());
}
}
示例7: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null)
plainSelect.getWhere().accept(this);
}
示例8: insertWhereAndExpression
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
/**
* 往where sql里面插入AND关系的表达式。
*
* 例如:whereSql为 where a!=3 or a!=2 limit 1
* condExpress为 deleted=0
* 那么返回:where deleted=0 and (a!=3 or a!=2) limit 1
*
* @param whereSql 从where起的sql子句,如果有where必须带上where关键字。
* @param condExpression 例如a=? 不带where或and关键字。
* @return 注意返回字符串前面没有空格
* @throws JSQLParserException
*/
public static String insertWhereAndExpression(String whereSql, String condExpression)
throws JSQLParserException {
if(condExpression == null || condExpression.trim().isEmpty()) {
return whereSql == null ? "" : whereSql;
}
if(whereSql == null || whereSql.trim().isEmpty()) {
return "WHERE " + condExpression;
}
whereSql = whereSql.trim();
if(!whereSql.toUpperCase().startsWith("WHERE ")) {
return "WHERE " + condExpression + " " + whereSql;
}
String selectSql = "select * from dual "; // 辅助where sql解析用
Statement statement = CCJSqlParserUtil.parse(selectSql + whereSql);
Select selectStatement = (Select) statement;
PlainSelect plainSelect = (PlainSelect)selectStatement.getSelectBody();
Expression ce = CCJSqlParserUtil.parseCondExpression(condExpression);
Expression oldWhere = plainSelect.getWhere();
Expression newWhere = new FixedAndExpression(ce, oldWhere);
plainSelect.setWhere(newWhere);
return plainSelect.toString().substring(selectSql.length());
}
示例9: parse
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的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;
}
示例10: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
}
示例11: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null)
plainSelect.getWhere().accept(this);
visitColumns(plainSelect);
}
示例12: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null)
plainSelect.getWhere().accept(this);
}
示例13: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
if (plainSelect.getJoins() != null) {
for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext();) {
Join join = (Join) joinsIt.next();
join.getRightItem().accept(this);
}
}
if (plainSelect.getWhere() != null)
plainSelect.getWhere().accept(this);
}
示例14: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect)
{
/*
* Check if the query uses DISTINCT flag
*/
checkContainDistinct(plainSelect);
FromItem fromItem = plainSelect.getFromItem();
visitFromItemExpression(fromItem);
/*
* Collect the tables in the JOIN statement
*/
List<Join> joins = plainSelect.getJoins();
if (joins != null) {
for (Join join : joins) {
visitJoinExpression(join);
}
}
/*
* Collect the filter expressions in WHERE statement
*/
Expression expr = plainSelect.getWhere();
if (expr != null) {
visitWhereExpression(expr);
}
/*
* Collect the select item expressions in SELECT statement.
*/
List<SelectItem> selectItemExpressions = plainSelect.getSelectItems();
SelectItemHandler selectItemHandler = new SelectItemHandler(this);
selectItemHandler.parse(selectItemExpressions);
}
示例15: visit
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
plainSelect.getFromItem().accept(this);
plainSelect.getSelectItems().forEach(item -> item.accept(this));
isSelect = false;
if (plainSelect.getWhere() != null) {
plainSelect.getWhere().accept(this);
}
}