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

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

java 1次浏览

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

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

示例1: visit

点赞 2

import com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression; //导入依赖的package包/类
@Override
public void visit(ComparisionEqualsExpression node) {
    Expression left = node.getLeftOprand();
    Expression right = node.getRightOprand();
    visitChild(2, false, false, left, right);

    if (verdictColumn) {
        if (left instanceof Identifier) {
            comparisionEquals((Identifier) left, right.evaluation(evaluationParameter), false, node);
        } else if (right instanceof Identifier) {
            comparisionEquals((Identifier) right, left.evaluation(evaluationParameter), false, node);
        }
    }
}
 

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

示例2: process

点赞 2

import com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression; //导入依赖的package包/类
public static ProcessorResult process(DMLSelectStatement select) {
    ProcessorResult result = new ProcessorResult();
    List<Pair<Expression, String>> selectExprList = select.getSelectExprList();
    TableReferences tableReferences = select.getTables();
    // 仅支持 select CORONA_NEXT_VAL (from table),一个select域,一张表,表可以不带
    if (selectExprList != null && selectExprList.size() == 1) {
        Expression selectExpr = selectExprList.get(0).getKey();
        if (selectExpr instanceof Identifier) {
            Identifier selectIdentifier = (Identifier) selectExpr;
            if (SEQ_NAME_IN_SQL.equalsIgnoreCase(selectIdentifier.getIdTextUpUnescape())
                || OLD_SEQ_NAME_IN_SQL.equalsIgnoreCase(selectIdentifier.getIdTextUpUnescape())) {
                result.flag = true;

                if (tableReferences != null) {
                    List<TableReference> tables = tableReferences.getTableReferenceList();
                    if (tables != null) {
                        if (tables.size() == 1) {
                            String tableName = ((TableRefFactor) tables.get(0)).getTable().getIdText();
                            result.name = tableName;
                        }
                    }
                }

                // 一次需要拿多少个值,根据where条件判断,where COUNT =
                // 100,如果没有where条件,一次获取一个值
                Expression where = select.getWhere();
                if (where instanceof ComparisionEqualsExpression) {
                    ComparisionEqualsExpression equalExp = (ComparisionEqualsExpression) where;
                    Expression left = equalExp.getLeftOprand();
                    Expression right = equalExp.getRightOprand();
                    if (left instanceof Identifier && right instanceof LiteralNumber) {
                        Identifier whereKey = (Identifier) left;
                        LiteralNumber whereValue = (LiteralNumber) right;
                        if (whereKey.getIdText().toUpperCase().equalsIgnoreCase(SEQ_WHERE_IN_SQL)
                            || whereKey.getIdText().toUpperCase().equalsIgnoreCase(OLD_SEQ_WHERE_IN_SQL)) {
                            result.count = whereValue.getNumber().intValue();
                        }
                    }
                }
            }
        }
    }

    return result;
}
 

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

示例3: visit

点赞 2

import com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression; //导入依赖的package包/类
@Override
public void visit(BinaryOperatorExpression node) {
    if (eval(node)) { // 计算出了结果
        return;
    }

    if (node instanceof ComparisionEqualsExpression) {
        this.handleBooleanFilter(node, OPERATION.EQ);
    } else if (node instanceof ComparisionGreaterThanExpression) {
        this.handleBooleanFilter(node, OPERATION.GT);
    } else if (node instanceof ComparisionGreaterThanOrEqualsExpression) {
        this.handleBooleanFilter(node, OPERATION.GT_EQ);
    } else if (node instanceof ComparisionLessOrGreaterThanExpression) {
        this.handleBooleanFilter(node, OPERATION.NOT_EQ);
    } else if (node instanceof ComparisionLessThanExpression) {
        this.handleBooleanFilter(node, OPERATION.LT);
    } else if (node instanceof ComparisionLessThanOrEqualsExpression) {
        this.handleBooleanFilter(node, OPERATION.LT_EQ);
    } else if (node instanceof ComparisionNotEqualsExpression) {
        this.handleBooleanFilter(node, OPERATION.NOT_EQ);
    } else if (node instanceof ComparisionNullSafeEqualsExpression) {
        throw new NotSupportException("not support '<=>' ");
    } else if (node instanceof ArithmeticAddExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.ADD);
    } else if (node instanceof ArithmeticDivideExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.DIVISION);
    } else if (node instanceof ArithmeticIntegerDivideExpression) {
        this.handleArithmetric(node, node.getOperator());
    } else if (node instanceof ArithmeticModExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.MOD);
    } else if (node instanceof ArithmeticMultiplyExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.MULTIPLY);
    } else if (node instanceof ArithmeticSubtractExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.SUB);
    } else if (node instanceof AssignmentExpression) {
        throw new NotSupportException("not support ':=' ");
    } else if (node instanceof BitAndExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.BITAND);
    } else if (node instanceof BitOrExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.BITOR);
    } else if (node instanceof BitShiftExpression) {
        if (((BitShiftExpression) node).isRightShift()) {
            this.handleArithmetric(node, IFunction.BuiltInFunction.BITRSHIFT);
        } else {
            this.handleArithmetric(node, IFunction.BuiltInFunction.BITLSHIFT);
        }
    } else if (node instanceof BitXORExpression) {
        this.handleArithmetric(node, IFunction.BuiltInFunction.BITXOR);
    } else if (node instanceof InExpression) {
        this.handleInExpression((InExpression) node);
    } else if (node instanceof LogicalXORExpression) {
        this.handleBooleanFilter(node, OPERATION.XOR);
    } else {
        throw new NotSupportException("not supported this BinaryOperatorExpression type " + node.getOperator());
    }
}
 

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

示例4: visit

点赞 2

import com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression; //导入依赖的package包/类
@Override
public void visit(ComparisionEqualsExpression node) {
    visit((BinaryOperatorExpression) node);
}
 

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

示例5: visit

点赞 1

import com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression; //导入依赖的package包/类
void visit(ComparisionEqualsExpression node); 

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


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