net.sf.jsqlparser.statement.delete.Delete.getWhere()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(215)

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

Delete.getWhere介绍

暂无

代码示例

代码示例来源:origin: baomidou/mybatis-plus

@Override
public void processDelete(Delete delete) {
  Assert.notNull(delete.getWhere(), "Prohibition of full table deletion");
}

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

public void deParse(Delete aDelete) {
  buffer
      .append(aDelete.getComment() != null ? aDelete.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "")
      .append("Delete").append(aDelete.getFromComment() != null ? " " + aDelete.getFromComment() + ExpressionDeParser.LINE_SEPARATOR : "").append(" From ")
      .append(aDelete.getTable().getComment() != null ? aDelete.getTable().getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(aDelete.getTable().getWholeTableName());
  if (aDelete.getWhere() != null) {
    buffer.append(aDelete.getWhereComment() != null ? " " + aDelete.getWhereComment() : "").append(ExpressionDeParser.LINE_SEPARATOR).append(" Where ");
    aDelete.getWhere().accept(expressionVisitor);
  }
  buffer.append(!"".equals(aDelete.getEndComment()) ? " " + aDelete.getEndComment() : "");
}

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

public void deParse(Delete delete) {
  buffer.append("DELETE FROM " + delete.getTable().getWholeTableName());
  if (delete.getWhere() != null) {
    buffer.append(" WHERE ");
    delete.getWhere().accept(expressionVisitor);
  }
}
public ExpressionVisitor getExpressionVisitor() {

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

@Override
public void visit(Delete delete) {
  visit(delete.getTable());
  if (delete.getJoins() != null) {
    for (Join join : delete.getJoins()) {
      join.getRightItem().accept(this);
    }
  }
  if (delete.getWhere() != null) {
    delete.getWhere().accept(this);
  }
}

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

public void deParse(Delete delete) {
  buffer.append("DELETE");
  if (delete.getTables() != null && delete.getTables().size() > 0) {
    for (Table table : delete.getTables()) {
      buffer.append(" ").append(table.getFullyQualifiedName());
    }
  }
  buffer.append(" FROM ").append(delete.getTable().toString());
  if (delete.getJoins() != null) {
    for (Join join : delete.getJoins()) {
      if (join.isSimple()) {
        buffer.append(", ").append(join);
      } else {
        buffer.append(" ").append(join);
      }
    }
  }
  if (delete.getWhere() != null) {
    buffer.append(" WHERE ");
    delete.getWhere().accept(expressionVisitor);
  }
  if (delete.getOrderByElements() != null) {
    new OrderByDeParser(expressionVisitor, buffer).deParse(delete.getOrderByElements());
  }
  if (delete.getLimit() != null) {
    new LimitDeparser(buffer).deParse(delete.getLimit());
  }
}

代码示例来源:origin: baomidou/mybatis-plus

/**
 * delete 语句处理
 */
@Override
public void processDelete(Delete delete) {
  if (tenantHandler.doTableFilter(delete.getTable().getName())) {
    // 过滤退出执行
    return;
  }
  delete.setWhere(this.andExpression(delete.getTable(), delete.getWhere()));
}

代码示例来源:origin: baomidou/mybatis-plus

@Test
  void deleteWhereParser() throws Exception {
    Delete delete = (Delete) CCJSqlParserUtil.parse("delete from tableName t");
    Assertions.assertNull(delete.getWhere());
  }
}

代码示例来源:origin: codingapi/tx-lcn

.setUnitId(unitId)
.setRollbackInfo(rollbackInfo)
.setSqlWhere(delete.getWhere().toString())
.setColumns(columns)
.setPrimaryKeys(primaryKeys)

代码示例来源:origin: baomidou/mybatis-plus

} else if (statement instanceof Delete) {
  Delete delete = (Delete) statement;
  where = delete.getWhere();
  table = delete.getTable();
  joins = delete.getJoins();

代码示例来源:origin: com.baomidou/mybatis-plus-extension

@Override
public void processDelete(Delete delete) {
  Assert.notNull(delete.getWhere(), "Prohibition of full table deletion");
}

代码示例来源:origin: wxbty/meepo

public static String name_delete_where(String sql) throws JSQLParserException {
  net.sf.jsqlparser.statement.Statement statement = CCJSqlParserUtil.parse(sql);
  Delete updateStatement = (Delete) statement;
  Expression where_expression = updateStatement.getWhere();
  if (where_expression == null)
    return "";
  String str = where_expression.toString();
  return str;
}

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

public void deParse(Delete delete) {
  buffer.append("DELETE FROM " + delete.getTable().getWholeTableName());
  if (delete.getWhere() != null) {
    buffer.append(" WHERE ");
    delete.getWhere().accept(expressionVisitor);
  }
}
public ExpressionVisitor getExpressionVisitor() {

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

@Override
public void visit(Delete s) {
  visit(s.getTable());
  if (s.getOrderByElements() != null) {
    s.getOrderByElements().forEach(o -> {
      o.accept(this);
    });
  }
  if (s.getWhere() != null) {
    s.getWhere().accept(this);
  }
}

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

@Override
public void visit(Delete delete) {
  visit(delete.getTable());
  if (delete.getJoins() != null) {
    for (Join join : delete.getJoins()) {
      join.getRightItem().accept(this);
    }
  }
  if (delete.getWhere() != null) {
    delete.getWhere().accept(this);
  }
}

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

public void deParse(Delete delete) {
  buffer.append("DELETE");
  if (delete.getTables() != null && delete.getTables().size() > 0) {
    for (Table table : delete.getTables()) {
      buffer.append(" ").append(table.getFullyQualifiedName());
    }
  }
  buffer.append(" FROM ").append(delete.getTable().toString());
  if (delete.getJoins() != null) {
    for (Join join : delete.getJoins()) {
      if (join.isSimple()) {
        buffer.append(", ").append(join);
      } else {
        buffer.append(" ").append(join);
      }
    }
  }
  if (delete.getWhere() != null) {
    buffer.append(" WHERE ");
    delete.getWhere().accept(expressionVisitor);
  }
  if (delete.getOrderByElements() != null) {
    new OrderByDeParser(expressionVisitor, buffer).deParse(delete.getOrderByElements());
  }
  if (delete.getLimit() != null) {
    new LimitDeparser(buffer).deParse(delete.getLimit());
  }
}

代码示例来源:origin: erdemcer/kafka-connect-oracle

delete.getWhere().accept(new ExpressionVisitorAdapter(){
 @Override
 public void visit(final EqualsTo expr){

代码示例来源:origin: com.baomidou/mybatis-plus-extension

/**
 * <p>
 * delete 语句处理
 * </p>
 */
@Override
public void processDelete(Delete delete) {
  if (tenantHandler.doTableFilter(delete.getTable().getName())) {
    // 过滤退出执行
    return;
  }
  delete.setWhere(this.andExpression(delete.getTable(), delete.getWhere()));
}

代码示例来源:origin: vincentrussell/sql-to-mongo-db-query-converter

public Builder setJSqlParser(CCJSqlParser jSqlParser) throws com.github.vincentrussell.query.mongodb.sql.converter.ParseException, ParseException {
  final Statement statement = jSqlParser.Statement();
  if (Select.class.isAssignableFrom(statement.getClass())) {
    sqlCommandType = SQLCommandType.SELECT;
    final PlainSelect plainSelect = (PlainSelect)(((Select)statement).getSelectBody());
    SqlUtils.isTrue(plainSelect != null, "could not parseNaturalLanguageDate SELECT statement from query");
    SqlUtils.isTrue(plainSelect.getFromItem()!=null,"could not find table to query.  Only one simple table name is supported.");
    whereClause = plainSelect.getWhere();
    isDistinct = (plainSelect.getDistinct() != null);
    isCountAll = SqlUtils.isCountAll(plainSelect.getSelectItems());
    SqlUtils.isTrue(plainSelect.getFromItem() != null, "could not find table to query.  Only one simple table name is supported.");
    table = plainSelect.getFromItem().toString();
    limit = SqlUtils.getLimit(plainSelect.getLimit());
    orderByElements1 = plainSelect.getOrderByElements();
    selectItems = plainSelect.getSelectItems();
    joins = plainSelect.getJoins();
    groupBys = SqlUtils.getGroupByColumnReferences(plainSelect);
    SqlUtils.isTrue(plainSelect.getFromItem() != null, "could not find table to query.  Only one simple table name is supported.");
  } else if (Delete.class.isAssignableFrom(statement.getClass())) {
    sqlCommandType = SQLCommandType.DELETE;
    Delete delete = (Delete)statement;
    SqlUtils.isTrue(delete.getTables().size() == 0, "there should only be on table specified for deletes");
    table = delete.getTable().toString();
    whereClause = delete.getWhere();
  }
  return this;
}

代码示例来源:origin: com.baomidou/mybatis-plus-extension

} else if (statement instanceof Delete) {
  Delete delete = (Delete) statement;
  where = delete.getWhere();
  table = delete.getTable();
  joins = delete.getJoins();

相关文章