Package com.alibaba.druid.sql.dialect.oracle.ast.clause

Examples of com.alibaba.druid.sql.dialect.oracle.ast.clause.SubqueryFactoringClause$Entry


        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) createExprParser().name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    createExprParser().names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) createExprParser().name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    createExprParser().exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(createExprParser().expr());
                    accept(Token.TO);
                    cycleClause.setValue(createExprParser().expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(createExprParser().expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here


        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) createExprParser().name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    createExprParser().names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) createExprParser().name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    createExprParser().exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(createExprParser().expr());
                    acceptIdentifier("TO");
                    cycleClause.setValue(createExprParser().expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(createExprParser().expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) createExprParser().name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    createExprParser().names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) createExprParser().name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    createExprParser().exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(createExprParser().expr());
                    accept(Token.TO);
                    cycleClause.setValue(createExprParser().expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(createExprParser().expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) this.exprParser.name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    exprParser.names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) exprParser.name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    exprParser.exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(exprParser.expr());
                    acceptIdentifier("TO");
                    cycleClause.setValue(exprParser.expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(exprParser.expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) createExprParser().name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    createExprParser().names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) createExprParser().parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) createExprParser().name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    createExprParser().exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(createExprParser().expr());
                    accept(Token.TO);
                    cycleClause.setValue(createExprParser().expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(createExprParser().expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) this.exprParser.name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    exprParser.names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) exprParser.name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    exprParser.exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(exprParser.expr());
                    acceptIdentifier("TO");
                    cycleClause.setValue(exprParser.expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(exprParser.expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

        OracleSelect select = new OracleSelect();

        if (lexer.token() == Token.WITH) {
            lexer.nextToken();

            SubqueryFactoringClause subqueryFactoringClause = new SubqueryFactoringClause();
            for (;;) {
                SubqueryFactoringClause.Entry entry = new SubqueryFactoringClause.Entry();
                entry.setName((SQLIdentifierExpr) this.exprParser.name());

                if (lexer.token() == Token.LPAREN) {
                    lexer.nextToken();
                    exprParser.names(entry.getColumns());
                    accept(Token.RPAREN);
                }

                accept(Token.AS);
                accept(Token.LPAREN);
                entry.setSubQuery(query());
                accept(Token.RPAREN);

                if (identifierEquals("SEARCH")) {
                    lexer.nextToken();
                    SearchClause searchClause = new SearchClause();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new SQLParseException("syntax erorr : " + lexer.token());
                    }

                    searchClause.setType(SearchClause.Type.valueOf(lexer.stringVal()));
                    lexer.nextToken();

                    acceptIdentifier("FIRST");
                    accept(Token.BY);

                    searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());

                    while (lexer.token() == (Token.COMMA)) {
                        lexer.nextToken();
                        searchClause.getItems().add((OracleOrderByItem) exprParser.parseSelectOrderByItem());
                    }

                    accept(Token.SET);

                    searchClause.setOrderingColumn((SQLIdentifierExpr) exprParser.name());

                    entry.setSearchClause(searchClause);
                }

                if (identifierEquals("CYCLE")) {
                    lexer.nextToken();
                    CycleClause cycleClause = new CycleClause();
                    exprParser.exprList(cycleClause.getAliases());
                    accept(Token.SET);
                    cycleClause.setMark(exprParser.expr());
                    acceptIdentifier("TO");
                    cycleClause.setValue(exprParser.expr());
                    accept(Token.DEFAULT);
                    cycleClause.setDefaultValue(exprParser.expr());
                    entry.setCycleClause(cycleClause);
                }

                subqueryFactoringClause.getEntries().add(entry);

                if (lexer.token() == Token.COMMA) {
                    lexer.nextToken();
                    continue;
                }
View Full Code Here

  }

  @Override
  protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    Entry e = entry(req);
    S3Object remove = map.remove(e);
    if (remove == null) {
      resp.sendError(404, "Not found " + e);
    } else {
      resp.sendError(HttpURLConnection.HTTP_NO_CONTENT, "Deleted");
View Full Code Here

    }

  }

  private Entry entry(HttpServletRequest req) {
    return new Entry(key(uri(req)));
  }
View Full Code Here

        log("doGet " + uri);
    if ("/".equals(uri.getPath())) {
      list(req, resp);
    } else {
      String key = uri.getPath().substring(1);
      Entry e = new Entry(key);
      S3Object obj = map.get(e);
        if (debug)
          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
View Full Code Here

TOP

Related Classes of com.alibaba.druid.sql.dialect.oracle.ast.clause.SubqueryFactoringClause$Entry

Copyright © 2018 www.massapicom. 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.