From 76c4c5486a239ddb8bb3827e415ca0c9d964a48d Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 22 Jan 2014 09:38:59 +0100 Subject: [PATCH] [#2970] Add DSL.isnull() as a synonym for NVL() for the SQL Server dialect --- jOOQ/src/main/java/org/jooq/impl/DSL.java | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 3bb12355eb..33088099d3 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -6141,6 +6141,78 @@ public class DSL { return function("coalesce", nullSafeDataType(field), nullSafe(combine(field, fields))); } + /** + * Gets the SQL Server-style ISNULL(value, defaultValue) function. + * + * @see #nvl(Field, Field) + */ + @Support + @Transition( + name = "ISNULL", + args = { + "Field", + "Field" + }, + to = "Function" + ) + public static Field isnull(T value, T defaultValue) { + return nvl(value, defaultValue); + } + + /** + * Gets the SQL Server-style ISNULL(value, defaultValue) function. + * + * @see #nvl(Field, Field) + */ + @Support + @Transition( + name = "ISNULL", + args = { + "Field", + "Field" + }, + to = "Function" + ) + public static Field isnull(T value, Field defaultValue) { + return nvl(value, defaultValue); + } + + /** + * Gets the SQL Server-style ISNULL(value, defaultValue) function. + * + * @see #nvl(Field, Field) + */ + @Support + @Transition( + name = "ISNULL", + args = { + "Field", + "Field" + }, + to = "Function" + ) + public static Field isnull(Field value, T defaultValue) { + return nvl(value, defaultValue); + } + + /** + * Gets the SQL Server-style ISNULL(value, defaultValue) function. + * + * @see #nvl(Field, Field) + */ + @Support + @Transition( + name = "ISNULL", + args = { + "Field", + "Field" + }, + to = "Function" + ) + public static Field isnull(Field value, Field defaultValue) { + return nvl(value, defaultValue); + } + /** * Gets the Oracle-style NVL(value, defaultValue) function. *