Examples of SQLExprTableSource


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

        if (lexer.token() == Token.SELECT) {
            throw new ParserException("TODO");
        }

        SQLExprTableSource tableReference = new SQLExprTableSource();

        parseTableSourceQueryTableExpr(tableReference);

        return parseTableSourceRest(tableReference);
    }
View Full Code Here

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

        if (x == null) {
            throw new IllegalStateException("x is null");
        }

        SQLExprTableSource tableSource = x.getTableSource();
        String alias = null;
        String matchTableName = null;
        String tenantColumn = null;
        SQLExpr tableExpr = tableSource.getExpr();
        if (tableExpr instanceof SQLIdentifierExpr) {
            String tableName = ((SQLIdentifierExpr) tableExpr).getName();

            if (tenantCallBack != null) {
                tenantColumn = tenantCallBack.getTenantColumn(StatementType.INSERT, tableName);
            }
            if (StringUtils.isEmpty(tenantColumn)
                && ServletPathMatcher.getInstance().matches(tenantTablePattern, tableName)) {
                tenantColumn = visitor.getConfig().getTenantColumn();
            }

            if (!StringUtils.isEmpty(tenantColumn)) {
                matchTableName = tableName;
                alias = tableSource.getAlias();
            }
        }

        if (matchTableName == null) {
            return;
View Full Code Here

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

    public static boolean isTopSelectOutFile(MySqlOutFileExpr x) {
        if (!(x.getParent() instanceof SQLExprTableSource)) {
            return false;
        }
        SQLExprTableSource tableSource = (SQLExprTableSource) x.getParent();
        return isTopSelectStatement(tableSource.getParent());
    }
View Full Code Here

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

            stmt.setIfExists(true);
        }

        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

            stmt.setIfExists(true);
        }

        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

        if (lexer.token() == Token.SELECT) {
            throw new ParserException("TODO");
        }

        SQLExprTableSource tableReference = new SQLExprTableSource();

        parseTableSourceQueryTableExpr(tableReference);

        return parseTableSourceRest(tableReference);
    }
View Full Code Here

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

    public SQLExprTableSource getLike() {
        return like;
    }

    public void setLike(SQLName like) {
        this.setLike(new SQLExprTableSource(like));
    }
View Full Code Here

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

        MySqlAnalyzeStatement stmt = new MySqlAnalyzeStatement();
        List<SQLName> names = new ArrayList<SQLName>();
        this.exprParser.names(names, stmt);

        for (SQLName name : names) {
            stmt.getTableSources().add(new SQLExprTableSource(name));
        }
        return stmt;
    }
View Full Code Here

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

        MySqlOptimizeStatement stmt = new MySqlOptimizeStatement();
        List<SQLName> names = new ArrayList<SQLName>();
        this.exprParser.names(names, stmt);

        for (SQLName name : names) {
            stmt.getTableSources().add(new SQLExprTableSource(name));
        }
        return stmt;
    }
View Full Code Here

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

        }

        String originalTable = getCurrentTable();

        if (x.getFrom() instanceof SQLExprTableSource) {
            SQLExprTableSource tableSource = (SQLExprTableSource) x.getFrom();
            if (tableSource.getExpr() instanceof SQLName) {
                String ident = tableSource.getExpr().toString();

                setCurrentTable(x, ident);
                x.putAttribute(ATTR_TABLE, ident);
                if (x.getParent() instanceof SQLSelect) {
                    x.getParent().putAttribute(ATTR_TABLE, ident);
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.