diff --git a/src/main/java/com/mysema/query/grammar/Grammar.java b/src/main/java/com/mysema/query/grammar/Grammar.java index 5770658b7..5ec2bfad0 100644 --- a/src/main/java/com/mysema/query/grammar/Grammar.java +++ b/src/main/java/com/mysema/query/grammar/Grammar.java @@ -202,23 +202,23 @@ public class Grammar { public static > ExprBoolean goe(Expr left, A right) { - return _binOp(OpNumber.GOE, left, _const(right)); + return _binOp(OpComparable.GOE, left, _const(right)); } public static > ExprBoolean goe(Expr left, Expr right) { - return _binOp(OpNumber.GOE, left, right); + return _binOp(OpComparable.GOE, left, right); } public static > ExprBoolean gt(Expr left, A right) { - return _binOp(OpNumber.GT, left, _const(right)); + return _binOp(OpComparable.GT, left, _const(right)); } public static > ExprBoolean gt(Expr left, Expr right) { - return _binOp(OpNumber.GT, left, right); + return _binOp(OpComparable.GT, left, right); } - + public static ExprBoolean in(A left, ExprEntity> right){ return _binOp(Op.INELEMENTS, _const(left), right); } @@ -246,12 +246,12 @@ public class Grammar { public static > ExprBoolean loe(Expr left, A right) { - return _binOp(OpNumber.LOE, left, _const(right)); + return _binOp(OpComparable.LOE, left, _const(right)); } public static > ExprBoolean loe(Expr left, Expr right) { - return _binOp(OpNumber.LOE, left, right); + return _binOp(OpComparable.LOE, left, right); } public static ExprNoEntity lower(Expr left) { @@ -259,12 +259,12 @@ public class Grammar { } public static > ExprBoolean lt(Expr left, A right) { - return _binOp(OpNumber.LT, left, _const(right)); + return _binOp(OpComparable.LT, left, _const(right)); } public static > ExprBoolean lt(Expr left, Expr right) { - return _binOp(OpNumber.LT, left, right); + return _binOp(OpComparable.LT, left, right); } public static ExprNoEntity mult(Expr left, A right) { diff --git a/src/main/java/com/mysema/query/grammar/Ops.java b/src/main/java/com/mysema/query/grammar/Ops.java index 05be2ea75..4f9b7a99e 100644 --- a/src/main/java/com/mysema/query/grammar/Ops.java +++ b/src/main/java/com/mysema/query/grammar/Ops.java @@ -29,66 +29,55 @@ public class Ops { /** * Boolean operators (operators used with boolean operands) */ - public interface OpBoolean extends OpComparable{ - OpBoolean AND = new OpBooleanImpl(); - OpBoolean NOT = new OpBooleanImpl(); - OpBoolean OR = new OpBooleanImpl(); - OpBoolean XNOR = new OpBooleanImpl(); - OpBoolean XOR = new OpBooleanImpl(); + public interface OpBoolean{ + Op AND = new OpImpl(); + Op NOT = new OpImpl(); + Op OR = new OpImpl(); + Op XNOR = new OpImpl(); + Op XOR = new OpImpl(); } - static class OpBooleanImpl implements OpBoolean{} - /** * Operators for Comparable objects */ - public interface OpComparable extends Op{ - OpComparable BETWEEN = new OpComparableImpl(); - OpComparable GOE = new OpComparableImpl(); - OpComparable GT = new OpComparableImpl(); - OpComparable LOE = new OpComparableImpl(); - OpComparable LT = new OpComparableImpl(); + public interface OpComparable{ + Op BETWEEN = new OpImpl(); + Op GOE = new OpImpl(); + Op GT = new OpImpl(); + Op LOE = new OpImpl(); + Op LT = new OpImpl(); } - static class OpComparableImpl implements OpComparable {} - /** * Date Operators (operators used with Date operands) */ - public interface OpDate extends OpComparable{ - OpDate AFTER = new OpDateImpl(); - OpDate BEFORE = new OpDateImpl(); + public interface OpDate{ + Op AFTER = new OpImpl(); + Op BEFORE = new OpImpl(); } - - static class OpDateImpl implements OpDate{} - - - static class OpImpl implements Op {} + + public static final class OpImpl implements Op {} /** * Numeric Operators (operators used with numeric operands) */ - public interface OpNumber extends OpComparable{ - OpNumber ADD = new OpNumberImpl(); - OpNumber DIV = new OpNumberImpl(); - OpNumber MOD = new OpNumberImpl(); - OpNumber MULT = new OpNumberImpl(); - OpNumber SUB = new OpNumberImpl(); + public interface OpNumber{ + Op ADD = new OpImpl(); + Op DIV = new OpImpl(); + Op MOD = new OpImpl(); + Op MULT = new OpImpl(); + Op SUB = new OpImpl(); } - static class OpNumberImpl implements OpNumber {} - /** * String Operators (operators used with String operands) */ - public interface OpString extends OpComparable{ - OpString CONCAT = new OpStringImpl(); - OpString LIKE = new OpStringImpl(); - OpString LOWER = new OpStringImpl(); - OpString SUBSTR = new OpStringImpl(); - OpString UPPER = new OpStringImpl(); + public interface OpString{ + Op CONCAT = new OpImpl(); + Op LIKE = new OpImpl(); + Op LOWER = new OpImpl(); + Op SUBSTR = new OpImpl(); + Op UPPER = new OpImpl(); } - static class OpStringImpl implements OpString{} - }