Package net.sf.jsqlparser.expression

Examples of net.sf.jsqlparser.expression.BinaryExpression


  }

  public static List<Expression> getSubExpressions(Expression expr) {
    final List<Expression> result = new ArrayList<Expression>();
    if (expr instanceof BinaryExpression) {
      final BinaryExpression be = (BinaryExpression) expr;
      result.add(be.getLeftExpression());
      result.add(be.getRightExpression());
    } else if (expr instanceof Parenthesis) {
      final Parenthesis prnths = (Parenthesis) expr;
      result.add(prnths.getExpression());
    } else if (expr instanceof Function) {
      final Function fun = (Function) expr;
View Full Code Here


    if (mine)
      return expr;

    Expression result = null;
    if (expr instanceof OrExpression || expr instanceof AndExpression) {
      final BinaryExpression be = (BinaryExpression) expr;
      result = appendOr(result, getMineSubset(source, be.getLeftExpression()));
      result = appendOr(result, getMineSubset(source, be.getRightExpression()));
    } else if (expr instanceof Parenthesis) {
      final Parenthesis prnth = (Parenthesis) expr;
      result = getMineSubset(source, prnth.getExpression());
    }
View Full Code Here

      jj_la1[87] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    rightExpression = ComparisonItem();
                BinaryExpression regCond = (BinaryExpression) result;
                regCond.setLeftExpression(leftExpression);
                regCond.setRightExpression(rightExpression);
                if (not)
                        regCond.setNot();
          {if (true) return result;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

        jj_la1[102] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      rightExpression = ConcatExpression();
                        BinaryExpression binExp = (BinaryExpression) result;
                        binExp.setLeftExpression(leftExpression);
                        binExp.setRightExpression(rightExpression);
                        leftExpression = result;
    }
      {if (true) return result;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

        jj_la1[103] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      rightExpression = MultiplicativeExpression();
                        BinaryExpression binExp = (BinaryExpression) result;
                        binExp.setLeftExpression(leftExpression);
                        binExp.setRightExpression(rightExpression);
                        leftExpression = result;
    }
      {if (true) return result;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

          jj_la1[106] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
                        BinaryExpression binExp = (BinaryExpression) result;
                        binExp.setLeftExpression(leftExpression);
                        binExp.setRightExpression(rightExpression);
                        leftExpression = result;
    }
      {if (true) return result;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

    }
    if(ex instanceof OrExpression||ex instanceof AndExpression){
      parent.put("subQuery", "1");
      parent.put("filter", (ex instanceof OrExpression)?"OR":"AND");
     
      BinaryExpression be = (BinaryExpression)ex;
      generateList(be.getLeftExpression(), linkList,parent);
      generateList(be.getRightExpression(), linkList,parent);
 
    }else if(ex instanceof Parenthesis){
      JSONArray sublist = new JSONArray();//{colname:{operate:1,value:xxxx}}
      JSONObject subQuery=new JSONObject();
      subQuery.put("subQuery", "1");
View Full Code Here

    }else{
      Column column = (Column)invokeMethod(e, "getLeftExpression");   
      oe.setColumnname(column.getColumnName());
    }
    if (e instanceof BinaryExpression) {
      BinaryExpression be = (BinaryExpression) e;
      oe.setExp(be.getStringExpression());
      if(be.getRightExpression() instanceof Function){
        oe.setValue(invokeMethod(be.getRightExpression(), "toString"));
      }else{
        oe.setValue(invokeMethod(be.getRightExpression(), "getValue"));
      }
    }else{
      oe.setExp((String)invokeMethod(e, "toString"));
    }
   
View Full Code Here

        Expression left = ExpressionQualifier.qualify(session, tableAliases,
                exp.getLeftExpression());
        Expression right = ExpressionQualifier.qualify(session, tableAliases,
                exp.getRightExpression());

        BinaryExpression qualified;

        if (exp instanceof Addition)
            qualified = new Addition();
        else if (exp instanceof Division)
            qualified = new Division();
        else if (exp instanceof Multiplication)
            qualified = new Multiplication();
        else if (exp instanceof Subtraction)
            qualified = new Subtraction();
        else if (exp instanceof EqualsTo)
            qualified = new EqualsTo();
        else if (exp instanceof GreaterThan)
            qualified = new GreaterThan();
        else if (exp instanceof GreaterThanEquals)
            qualified = new GreaterThanEquals();
        else if (exp instanceof LikeExpression)
            qualified = new LikeExpression();
        else if (exp instanceof MinorThan)
            qualified = new MinorThan();
        else if (exp instanceof MinorThanEquals)
            qualified = new MinorThanEquals();
        else if (exp instanceof NotEqualsTo)
            qualified = new NotEqualsTo();
        else
            throw new IllegalArgumentException("Unknown binary expression: " + exp);

        qualified.setLeftExpression(left);
        qualified.setRightExpression(right);

        this._qualifiedExpression = qualified;
    }
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.expression.BinaryExpression

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.