[#3914] Add additional DSL.param() methods to create unnamed bind value placeholders
This commit is contained in:
parent
c21dfd2f31
commit
308dd68691
@ -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.
|
||||
* <p>
|
||||
* 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)}
|
||||
* <ul>
|
||||
* <li> {@link SQLDialect#DB2}</li>
|
||||
* <li> {@link SQLDialect#DERBY}</li>
|
||||
* <li> {@link SQLDialect#H2}</li>
|
||||
* <li> {@link SQLDialect#HSQLDB}</li>
|
||||
* <li> {@link SQLDialect#INGRES}</li>
|
||||
* <li> {@link SQLDialect#SYBASE}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see #param(String, Object)
|
||||
*/
|
||||
@Support
|
||||
public static <T> Param<Object> param() {
|
||||
return param(Object.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an unnamed parameter with a defined type and no initial value.
|
||||
*
|
||||
* @see #param(String, Object)
|
||||
*/
|
||||
@Support
|
||||
public static <T> Param<T> param(Class<T> 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 <T> Param<T> param(DataType<T> type) {
|
||||
return new Val<T>(null, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a named parameter with a generic type ({@link Object} /
|
||||
* {@link SQLDataType#OTHER}) and no initial value.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user