• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MTSSetTransactionStatement类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement的典型用法代码示例。如果您正苦于以下问题:Java MTSSetTransactionStatement类的具体用法?Java MTSSetTransactionStatement怎么用?Java MTSSetTransactionStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MTSSetTransactionStatement类属于com.alibaba.cobar.parser.ast.stmt.mts包,在下文中一共展示了MTSSetTransactionStatement类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: visit

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
@Override
public void visit(MTSSetTransactionStatement node) {
    appendable.append("SET ");
    VariableScope scope = node.getScope();
    if (scope != null) {
        switch (scope) {
            case SESSION:
                appendable.append("SESSION ");
                break;
            case GLOBAL:
                appendable.append("GLOBAL ");
                break;
            default:
                throw new IllegalArgumentException("unknown scope for SET TRANSACTION ISOLATION LEVEL: " + scope);
        }
    }
    appendable.append("TRANSACTION ISOLATION LEVEL ");
    switch (node.getLevel()) {
        case READ_COMMITTED:
            appendable.append("READ COMMITTED");
            break;
        case READ_UNCOMMITTED:
            appendable.append("READ UNCOMMITTED");
            break;
        case REPEATABLE_READ:
            appendable.append("REPEATABLE READ");
            break;
        case SERIALIZABLE:
            appendable.append("SERIALIZABLE");
            break;
        default:
            throw new IllegalArgumentException("unknown level for SET TRANSACTION ISOLATION LEVEL: "
                                               + node.getLevel());
    }
}
 

开发者ID:loye168,
项目名称:tddl5,
代码行数:36,
代码来源:MySQLOutputASTVisitor.java

示例2: visit

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
@Override
public void visit(MTSSetTransactionStatement node) {
    appendable.append("SET ");
    VariableScope scope = node.getScope();
    if (scope != null) {
        switch (scope) {
        case SESSION:
            appendable.append("SESSION ");
            break;
        case GLOBAL:
            appendable.append("GLOBAL ");
            break;
        default:
            throw new IllegalArgumentException("unknown scope for SET TRANSACTION ISOLATION LEVEL: " + scope);
        }
    }
    appendable.append("TRANSACTION ISOLATION LEVEL ");
    switch (node.getLevel()) {
    case READ_COMMITTED:
        appendable.append("READ COMMITTED");
        break;
    case READ_UNCOMMITTED:
        appendable.append("READ UNCOMMITTED");
        break;
    case REPEATABLE_READ:
        appendable.append("REPEATABLE READ");
        break;
    case SERIALIZABLE:
        appendable.append("SERIALIZABLE");
        break;
    default:
        throw new IllegalArgumentException("unknown level for SET TRANSACTION ISOLATION LEVEL: " + node.getLevel());
    }
}
 

开发者ID:alibaba,
项目名称:cobar,
代码行数:35,
代码来源:MySQLOutputASTVisitor.java

示例3: setMTSSetTransactionStatement

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
/**
 * first token is <code>TRANSACTION</code>
 */
private MTSSetTransactionStatement setMTSSetTransactionStatement(VariableScope scope)
                                                                                     throws SQLSyntaxErrorException {
    lexer.nextToken();
    matchIdentifier("ISOLATION");
    matchIdentifier("LEVEL");

    SpecialIdentifier si;
    switch (lexer.token()) {
        case KW_READ:
            lexer.nextToken();
            si = specialIdentifiers.get(lexer.stringValueUppercase());
            if (si != null) {
                switch (si) {
                    case COMMITTED:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(scope,
                            MTSSetTransactionStatement.IsolationLevel.READ_COMMITTED);
                    case UNCOMMITTED:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(scope,
                            MTSSetTransactionStatement.IsolationLevel.READ_UNCOMMITTED);
                }
            }
            throw err("unknown isolation read level: " + lexer.stringValue());
        case IDENTIFIER:
            si = specialIdentifiers.get(lexer.stringValueUppercase());
            if (si != null) {
                switch (si) {
                    case REPEATABLE:
                        lexer.nextToken();
                        match(KW_READ);
                        return new MTSSetTransactionStatement(scope,
                            MTSSetTransactionStatement.IsolationLevel.REPEATABLE_READ);
                    case SERIALIZABLE:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(scope,
                            MTSSetTransactionStatement.IsolationLevel.SERIALIZABLE);
                }
            }
    }
    throw err("unknown isolation level: " + lexer.stringValue());
}
 

开发者ID:loye168,
项目名称:tddl5,
代码行数:46,
代码来源:MySQLDALParser.java

示例4: visit

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
@Override
public void visit(MTSSetTransactionStatement node) {
}
 

开发者ID:loye168,
项目名称:tddl5,
代码行数:4,
代码来源:EmptySQLASTVisitor.java

示例5: setMTSSetTransactionStatement

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
/**
 * first token is <code>TRANSACTION</code>
 */
private MTSSetTransactionStatement setMTSSetTransactionStatement(VariableScope scope)
                                                                                     throws SQLSyntaxErrorException {
    lexer.nextToken();
    matchIdentifier("ISOLATION");
    matchIdentifier("LEVEL");

    SpecialIdentifier si;
    switch (lexer.token()) {
        case KW_READ:
            lexer.nextToken();
            si = specialIdentifiers.get(lexer.stringValueUppercase());
            if (si != null) {
                switch (si) {
                    case COMMITTED:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(
                                                              scope,
                                                              MTSSetTransactionStatement.IsolationLevel.READ_COMMITTED);
                    case UNCOMMITTED:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(
                                                              scope,
                                                              MTSSetTransactionStatement.IsolationLevel.READ_UNCOMMITTED);
                }
            }
            throw err("unknown isolation read level: " + lexer.stringValue());
        case IDENTIFIER:
            si = specialIdentifiers.get(lexer.stringValueUppercase());
            if (si != null) {
                switch (si) {
                    case REPEATABLE:
                        lexer.nextToken();
                        match(KW_READ);
                        return new MTSSetTransactionStatement(
                                                              scope,
                                                              MTSSetTransactionStatement.IsolationLevel.REPEATABLE_READ);
                    case SERIALIZABLE:
                        lexer.nextToken();
                        return new MTSSetTransactionStatement(
                                                              scope,
                                                              MTSSetTransactionStatement.IsolationLevel.SERIALIZABLE);
                }
            }
    }
    throw err("unknown isolation level: " + lexer.stringValue());
}
 

开发者ID:beebeandwer,
项目名称:TDDL,
代码行数:50,
代码来源:MySQLDALParser.java

示例6: setMTSSetTransactionStatement

点赞 2

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
/**
 * first token is <code>TRANSACTION</code>
 */
private MTSSetTransactionStatement setMTSSetTransactionStatement(VariableScope scope)
        throws SQLSyntaxErrorException {
    lexer.nextToken();
    matchIdentifier("ISOLATION");
    matchIdentifier("LEVEL");

    SpecialIdentifier si;
    switch (lexer.token()) {
    case KW_READ:
        lexer.nextToken();
        si = specialIdentifiers.get(lexer.stringValueUppercase());
        if (si != null) {
            switch (si) {
            case COMMITTED:
                lexer.nextToken();
                return new MTSSetTransactionStatement(
                        scope,
                        MTSSetTransactionStatement.IsolationLevel.READ_COMMITTED);
            case UNCOMMITTED:
                lexer.nextToken();
                return new MTSSetTransactionStatement(
                        scope,
                        MTSSetTransactionStatement.IsolationLevel.READ_UNCOMMITTED);
            }
        }
        throw err("unknown isolation read level: " + lexer.stringValue());
    case IDENTIFIER:
        si = specialIdentifiers.get(lexer.stringValueUppercase());
        if (si != null) {
            switch (si) {
            case REPEATABLE:
                lexer.nextToken();
                match(KW_READ);
                return new MTSSetTransactionStatement(
                        scope,
                        MTSSetTransactionStatement.IsolationLevel.REPEATABLE_READ);
            case SERIALIZABLE:
                lexer.nextToken();
                return new MTSSetTransactionStatement(scope, MTSSetTransactionStatement.IsolationLevel.SERIALIZABLE);
            }
        }
    }
    throw err("unknown isolation level: " + lexer.stringValue());
}
 

开发者ID:alibaba,
项目名称:cobar,
代码行数:48,
代码来源:MySQLDALParser.java

示例7: visit

点赞 1

import com.alibaba.cobar.parser.ast.stmt.mts.MTSSetTransactionStatement; //导入依赖的package包/类
void visit(MTSSetTransactionStatement node); 

开发者ID:loye168,
项目名称:tddl5,
代码行数:2,
代码来源:SQLASTVisitor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)