From 9c13c0e1e7f2381e93532bf9ffc3fcd967f71b8b Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 30 Nov 2006 23:38:52 +0000 Subject: [PATCH] Added LessThan and GreaterThan operators. --- .../jdbc/depot/operator/Conditionals.java | 50 +++++++++++++++++++ .../samskivert/jdbc/depot/operator/Logic.java | 1 - 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java b/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java index d7257df..c5867f5 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Conditionals.java @@ -96,6 +96,56 @@ public abstract class Conditionals } } + /** The SQL '<' operator. */ + public static class LessThan extends BinaryOperator + { + public LessThan (String pColumn, Comparable value) + { + super(new ColumnExp(pColumn), value); + } + + public LessThan (SQLExpression column, Comparable value) + { + super(column, value); + } + + public LessThan (SQLExpression column, SQLExpression value) + { + super(column, value); + } + + @Override + protected String operator() + { + return "<"; + } + } + + /** The SQL '>' operator. */ + public static class GreaterThan extends BinaryOperator + { + public GreaterThan (String pColumn, Comparable value) + { + super(new ColumnExp(pColumn), value); + } + + public GreaterThan (SQLExpression column, Comparable value) + { + super(column, value); + } + + public GreaterThan (SQLExpression column, SQLExpression value) + { + super(column, value); + } + + @Override + protected String operator() + { + return ">"; + } + } + /** The SQL 'in (...)' operator. */ public static class In implements SQLOperator diff --git a/src/java/com/samskivert/jdbc/depot/operator/Logic.java b/src/java/com/samskivert/jdbc/depot/operator/Logic.java index 69f689b..8c7b795 100644 --- a/src/java/com/samskivert/jdbc/depot/operator/Logic.java +++ b/src/java/com/samskivert/jdbc/depot/operator/Logic.java @@ -66,7 +66,6 @@ public abstract class Logic } } - /** * Represents the truth negation of another conditon. */