From 86767b91beda2dfd36a4dbc4d29acfc5892c9a1f Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 30 Nov 2006 23:38:52 +0000 Subject: [PATCH] Added LessThan and GreaterThan operators. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1988 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../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 d7257df2..c5867f54 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 69f689ba..8c7b7956 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. */