Examples of SQLExprTableSource


Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

  public SQLExprTableSource getReferenceTable() {
    return referenceTable;
  }

  public void setReferenceTable(SQLName name) {
    this.referenceTable = new SQLExprTableSource(name);
  }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

  public void addPrimaryKey(SQLExpr primaryKey) {
    primaryKeys.add(primaryKey);
  }

  public void setInTableName(SQLName name) {
    parentTableSource = new SQLExprTableSource(name);
  }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

  public void setTableSource(SQLExprTableSource tableSource) {
    this.tableSource = tableSource;
  }

  public void setTableSource(SQLName name) {
    this.tableSource = new SQLExprTableSource(name);
  }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

   *
   */
  private void getAlterTablePlan(ParseContext context,
      MySqlAlterTableStatement sqlAlterTableStatement,
      MetaEventOperation metaEventOperation) throws IOException {
    SQLExprTableSource tableSource = sqlAlterTableStatement.getTableSource();
    String tableName = parseFromClause(tableSource);
    // check if table exists and get Table info
    FTable oldTable = metaEventOperation.checkAndGetTable(tableName, true);

    FTable newTable = FTable.clone(oldTable);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

     * primary key(user_id, photo_id) IN TABLE user,ENTITY GROUP KEY(user_id)
     * references User;";
     */

    // Table Info
    SQLExprTableSource tableSource = waspSqlCreateTableStatement
        .getTableSource();
    String tableName = parseFromClause(tableSource);
    // Check Table Name is legal.
    metaEventOperation.isLegalTableName(tableName);
    // Check if the table exists
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

   */
  public String parseFromClause(SQLTableSource from)
      throws UnsupportedException {
    // only support SQLExprTableSource now
    if (from instanceof SQLExprTableSource) {
      SQLExprTableSource fromExpr = (SQLExprTableSource) from;
      SQLExpr expr = fromExpr.getExpr(); // SQLIdentifierExpr
      return parseName(expr);
    } else if (from instanceof SQLJoinTableSource) {
      // TODO impl join clause
      throw new UnsupportedException("Join clause Unsupported");
    } else if (from instanceof SQLSubqueryTableSource) {
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

        SQLDropTableStatement stmt = new SQLDropTableStatement();

        for (;;) {
            SQLName name = this.exprParser.name();
            stmt.getTableSources().add(new SQLExprTableSource(name));
            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

                    lexer.nextToken();
                }

                SQLExpr name = this.createExprParser().name();

                queryBlock.setInto(new SQLExprTableSource(name));
            }
        }

        parseFrom(queryBlock);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

            expr.setParent(selectItem);
        }

        if (x.getFrom() == null) {
            Entity firstEntity = visitor.getEngine().getFirstEntity(visitor.getContext());
            SQLExprTableSource from = new SQLExprTableSource(new SQLIdentifierExpr(firstEntity.getName()));
            from.putAttribute(MAPPING_ENTITY, firstEntity);
            x.setFrom(from);
            x.putAttribute(MAPPING_ENTITY, firstEntity);
        }

        for (SQLSelectItem item : x.getSelectList()) {
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLExprTableSource

        modeLocal.set(Mode.Select);

        String originalTable = currentTableLocal.get();

        if (x.getFrom() instanceof SQLExprTableSource) {
            SQLExprTableSource tableSource = (SQLExprTableSource) x.getFrom();
            if (tableSource.getExpr() instanceof SQLIdentifierExpr) {
                String ident = ((SQLIdentifierExpr) tableSource.getExpr()).getName();
                currentTableLocal.set(ident);
                x.putAttribute("_old_local_", originalTable);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.