Java Code Examples for net.sf.jsqlparser.expression.BinaryExpression

The following examples show how to use net.sf.jsqlparser.expression.BinaryExpression. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: openprodoc   Source File: ObjPD.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
private int EvalExprType(Expression where)
{
if (where instanceof AndExpression)
    return (EXPR_AND);
else if (where instanceof OrExpression)
    return (EXPR_OR);
else if (where instanceof BinaryExpression)
    return(EXPR_BASIC);
else if (where instanceof Function)
    return(EXPR_FUNCT);
else if (where instanceof Parenthesis)
    return (EXPR_PAR);
else if (where instanceof InExpression) 
    return (EXPR_IN);
else if (where instanceof NotExpression) 
    return (EXPR_NOT);
return(-1);
}
 
Example 2
protected void visitBinaryExpression(BinaryExpression expr) {
  	this.isBaseAliasOrValue = true;
  	expr.getLeftExpression().accept(this);
  	if(!this.isBaseAliasOrValue) {
  		expr.getRightExpression().accept(this);
}
  	else {
  		expr.getRightExpression().accept(this);
          if(this.isBaseAliasOrValue && !(expr instanceof AndExpression || expr instanceof OrExpression)) {
  			this.setOrAndExpression(outputMatch,expr);
  		}
  	}
  }
 
Example 3
Source Project: quetzal   Source File: CTEToNestedQueryConverter.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public void visitBinary(BinaryExpression exp, boolean allowLeftAndRightTable) {
	clear();
	boolean prevIsTopVal = isTopLevel;
	boolean tmpLeftTableFound = false;
	boolean tmpRightTableFound = false;
	boolean tmpWhereOnlyExpFound = false;
	isTopLevel = false;
	exp.getLeftExpression().accept(this);
	// update tmp
	tmpLeftTableFound |= leftTableFound;
	tmpRightTableFound |= rightTableFound;
	tmpWhereOnlyExpFound |= whereOnlyExpFound;
	//
	exp.getRightExpression().accept(this);
	//update tmp
	tmpLeftTableFound |= leftTableFound;
	tmpRightTableFound |= rightTableFound;
	tmpWhereOnlyExpFound |= whereOnlyExpFound;
	//
	
	// update 
	leftTableFound = tmpLeftTableFound;
	rightTableFound = tmpRightTableFound;
	whereOnlyExpFound = tmpWhereOnlyExpFound;
	//
	if (!allowLeftAndRightTable && leftTableFound && rightTableFound) {
		whereOnlyExpFound = true;
	}
	isTopLevel = prevIsTopVal;
	defaultTopLevelProcessing(exp);
}
 
Example 4
public void visitBinaryExpression(BinaryExpression binaryExpression) {
    binaryExpression.getLeftExpression()
            .accept(new ExpressionVisitorImpl());
    binaryExpression.getRightExpression().accept(
            new ExpressionVisitorImpl());
}