From 308dd68691a87eef490da8ce59e5e55919edf19c Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 20 Jan 2015 10:50:50 +0100 Subject: [PATCH] [#3914] Add additional DSL.param() methods to create unnamed bind value placeholders --- jOOQ/src/main/java/org/jooq/impl/DSL.java | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index bca69c21c6..6646f01ece 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -11200,6 +11200,50 @@ public class DSL { // XXX Bind values // ------------------------------------------------------------------------- + /** + * Create an unnamed parameter with a generic type ({@link Object} / + * {@link SQLDataType#OTHER}) and no initial value. + *

+ * Try to avoid this method when using any of these databases, as these + * databases may have trouble inferring the type of the bind value. Use + * typed named parameters instead, using {@link #param(Class)} or + * {@link #param(DataType)} + *

+ * + * @see #param(String, Object) + */ + @Support + public static Param param() { + return param(Object.class); + } + + /** + * Create an unnamed parameter with a defined type and no initial value. + * + * @see #param(String, Object) + */ + @Support + public static Param param(Class type) { + return param(DefaultDataType.getDataType(null, type)); + } + + /** + * Create an unnamed parameter with a defined type and no initial value. + * + * @see #param(String, Object) + */ + @Support + public static Param param(DataType type) { + return new Val(null, type); + } + /** * Create a named parameter with a generic type ({@link Object} / * {@link SQLDataType#OTHER}) and no initial value.