T
- The parameter typepublic interface Parameter<T> extends QueryPart
Modifier and Type | Method and Description |
---|---|
Binding<?,T> |
getBinding()
The parameter's underlying
Binding . |
Converter<?,T> |
getConverter()
The parameter's underlying
Converter . |
DataType<T> |
getDataType()
The type of this parameter (might not be dialect-specific)
|
DataType<T> |
getDataType(Configuration configuration)
The dialect-specific type of this parameter
|
String |
getName()
The name of this parameter
|
Class<T> |
getType()
The Java type of the parameter.
|
boolean |
isDefaulted()
Whether this parameter has a default value
Procedures and functions with defaulted parameters behave slightly
different from ones without defaulted parameters.
|
boolean |
isUnnamed()
Whether this parameter has a name or not.
|
String getName()
DataType<T> getDataType(Configuration configuration)
boolean isDefaulted()
Procedures and functions with defaulted parameters behave slightly
different from ones without defaulted parameters. In PL/SQL and other
procedural languages, it is possible to pass parameters by name,
reordering names and omitting defaulted parameters:
CREATE PROCEDURE MY_PROCEDURE (P_DEFAULTED IN NUMBER := 0
P_MANDATORY IN NUMBER);
-- The above procedure can be called as such:
BEGIN
-- Assign parameters by index
MY_PROCEDURE(1, 2);
-- Assign parameters by name
MY_PROCEDURE(P_DEFAULTED => 1,
P_MANDATORY => 2);
-- Omitting defaulted parameters
MY_PROCEDURE(P_MANDATORY => 2);
END;
If a procedure has defaulted parameters, jOOQ binds them by name, rather than by index.
Currently, this is only supported for Oracle 11g
boolean isUnnamed()
Some databases (e.g. SQLDialect.POSTGRES
) allow for using unnamed
parameters. In this case, getName()
will return a synthetic name
created from the parameter index.
Copyright © 2016. All Rights Reserved.