From 730f4c79aeff08c1fb7df6de65a2ed40463a7425 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 8 Dec 2010 19:18:52 +0000 Subject: [PATCH] Make the creation of true and false literals less hacky. --- src/main/java/com/samskivert/depot/Exps.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/samskivert/depot/Exps.java b/src/main/java/com/samskivert/depot/Exps.java index b8ff573..7d29aee 100644 --- a/src/main/java/com/samskivert/depot/Exps.java +++ b/src/main/java/com/samskivert/depot/Exps.java @@ -39,6 +39,22 @@ public class Exps return new ValueExp(value); } + /** + * Creates an expression that evaluates to true. + */ + public static SQLExpression trueLiteral () + { + return literal("true"); + } + + /** + * Creates an expression that evaluates to false. + */ + public static SQLExpression falseLiteral () + { + return literal("false"); + } + /** * Creates a literal expression with the supplied SQL snippet. Note: you're probably breaking * cross platform compatibility by using this construction.