Deprecated
as a consequence of ParamOrVariable being deprecated. See corresponding docs for further information.
A lot of jOOQ API accepts user input values, such as for example when
creating a Condition using Field#eq(Object), where a column
expression is being compared with a value.
Behind the scenes, jOOQ wraps the value in a bind value expression using
DSL#val(Object). The generated SQL of such an expression depends on
things like Settings#getStatementType() or ParamType being
passed to configurations or Query#getSQL(ParamType) calls, etc. By
default, a parameter marker ? is generated.
Users can create parameters explicitly using DSL API, which is useful
in a few cases where the value cannot be passed to jOOQ directly, e.g.
Field references and Param values are mixedExample:
// Assuming import static org.jooq.impl.DSL.*;
// The bind value is the first operand of an expression, in case of which it
// needs to be wrapped in a Param explicitly
using(configuration)
.select()
.from(RENTALS)
.where(val(LocalDateTime.now()).between(RENTALS.RENTAL_DATE).and(RENTALS.DUE_DATE))
.fetch();
// The bind value is mixed with other types of Field expressions in a statement
using(configuration)
.insertInto(ACTOR)
.columns(ACTOR.FIRST_NAME, ACTOR.LAST_NAME, ACTOR.LAST_UPDATE)
.values(val("John"), val("Doe"), currentTimestamp())
.execute();
Instances can be created using DSL#param(String, Object),
DSL#val(Object), DSL#inline(Object) and respective overloads.
DSL#param(String, Object)
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public @NotNull Param | |
| public T | |
| public @NotNull Param | |
| public @NotNull ParamMode | |
| public @Nullable String | |
| public @NotNull ParamType | |
| public T | |
| public boolean | |
| public void | setConverted(Object value)
Deprecated
for removal since 3.8. - 3.8.0 - [#4991] In jOOQ 4.0,
Sets a converted value, using this Param will be made
immutable.
Param's underlying
DataType, obtained from getDataType()
|
| public void | |
| public void |
| $inline | back to summary |
|---|---|
| public boolean $inline() Experimental query object model accessor method, see also
| |
| $inline | back to summary |
|---|---|
| public @NotNull Param Deprecated as a consequence of Experimental query object model accessor method, see also
| |
| $value | back to summary |
|---|---|
| public T $value() Experimental query object model accessor method, see also
| |
| $value | back to summary |
|---|---|
| public @NotNull Param Deprecated as a consequence of Experimental query object model accessor method, see also
| |
| getParamMode | back to summary |
|---|---|
| public @NotNull ParamMode getParamMode() The parameter mode.
| |
| getParamName | back to summary |
|---|---|
| public @Nullable String getParamName() The parameter name. This name is useful for two things:
| |
| getParamType | back to summary |
|---|---|
| public @NotNull ParamType getParamType() The parameter type.
| |
| getValue | back to summary |
|---|---|
| public T getValue() Get the parameter's underlying value. This returns
| |
| isInline | back to summary |
|---|---|
| public boolean isInline() A flag on the bind value to force it to be inlined in rendered SQL | |
| setConverted | back to summary |
|---|---|
| public void setConverted(Object value) throws DataTypeException
Deprecated for removal since 3.8. - 3.8.0 - [#4991] In jOOQ 4.0, Sets a converted value, using this
| |
| setInline | back to summary |
|---|---|
| public void setInline(boolean inline)
Deprecated for removal since 3.8. - 3.8.0 - [#4991] In jOOQ 4.0, A flag on the bind value to force it to be inlined in rendered SQL
| |
| setValue | back to summary |
|---|---|
| public void setValue(T value)
Deprecated for removal since 3.8. - 3.8.0 - [#4991] In jOOQ 4.0, Set the parameter's underlying value. This is the same as
| |