From 44fc9fd1f7bb4615bcd53bb22d9caf3377875ba9 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 26 Apr 2014 13:27:19 +0200 Subject: [PATCH] [#3205] Add DSL.condition(Boolean) as a convenience for condition(Field) --- .../jooq/test/_/testcases/PredicateTests.java | 6 ++++++ jOOQ/src/main/java/org/jooq/impl/DSL.java | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/jOOQ-test/src/org/jooq/test/_/testcases/PredicateTests.java b/jOOQ-test/src/org/jooq/test/_/testcases/PredicateTests.java index aa37950d17..f6f3846008 100644 --- a/jOOQ-test/src/org/jooq/test/_/testcases/PredicateTests.java +++ b/jOOQ-test/src/org/jooq/test/_/testcases/PredicateTests.java @@ -583,6 +583,9 @@ extends BaseTest + * Databases that support boolean data types can use boolean expressions + * as predicates or as columns interchangeably. This extends to any type + * of field, including functions. A Postgres example: + *

+ *

+     * select 1 where texteq('a', 'a');
+     * 
+ * + * @param value The boolean expression. + * @return A condition wrapping the boolean expression + */ + @Support + public static Condition condition(Boolean value) { + return condition(Utils.field(value, Boolean.class)); + } + /** * Create a condition from a boolean field. *