From 195fabe2cc6ca37db0ca97bb5a2887f722e6ba1f Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 16 May 2008 02:10:07 +0000 Subject: [PATCH] We need parens so that operators are evaluated in the right order. This adds extra params around a bunch of things. I'll let the gods of Depot sort that out. BTW: Arithmetic.Div is still totally broken. It somehow booches the prepared statement. I tried changing the operator String to "//" and that sorta worked, but then the next operator over was missing... I'm working around this using Mul, but it'd be nice.. --- src/java/com/samskivert/jdbc/depot/BuildVisitor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java/com/samskivert/jdbc/depot/BuildVisitor.java b/src/java/com/samskivert/jdbc/depot/BuildVisitor.java index 447e1c8..18e29d1 100644 --- a/src/java/com/samskivert/jdbc/depot/BuildVisitor.java +++ b/src/java/com/samskivert/jdbc/depot/BuildVisitor.java @@ -188,9 +188,11 @@ public abstract class BuildVisitor implements ExpressionVisitor public void visit (BinaryOperator binaryOperator) throws Exception { + _builder.append('('); binaryOperator.getLeftHandSide().accept(this); _builder.append(binaryOperator.operator()); binaryOperator.getRightHandSide().accept(this); + _builder.append(')'); } public void visit (IsNull isNull)