Row value expressions are mainly useful for use in predicates, when comparing several values in one go, which can be more elegant than expanding the row value expression predicate in other equivalent syntaxes. This is especially true for non-equality predicates. For instance, the following two predicates are equivalent in SQL:
(A, B) > (X, Y)
(A > X) OR (A = X AND B > Y)
Example:
// Assuming import static org.jooq.impl.DSL.*;
using(configuration)
.select()
.from(CUSTOMER)
.where(row(CUSTOMER.FIRST_NAME, CUSTOMER.LAST_NAME).in(
select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME).from(ACTOR)
))
.fetch();
Note
Not all databases support row value expressions, but many row value expression operations can be emulated on all databases. See relevant row value expression method Javadocs for details.
Instances can be created using DSL#row(Object. and overloads.
| Modifier and Type | Method and Description |
|---|---|
| public @NotNull QOM. | |
| public @NotNull Condition | |
| public @NotNull Condition | |
| public int |
| $fields | back to summary |
|---|---|
| public @NotNull QOM. Experimental query object model accessor method, see also
| |
| isNotNull | back to summary |
|---|---|
| public @NotNull Condition isNotNull()
Deprecated as a consequence of Check if this row value expression contains no
Row NOT NULL predicates can be emulated in those databases that do not
support such predicates natively: Note that the two following predicates are NOT equivalent:
| |
| isNull | back to summary |
|---|---|
| public @NotNull Condition isNull()
Deprecated as a consequence of Check if this row value expression contains only
Row NULL predicates can be emulated in those databases that do not
support such predicates natively: | |
| size | back to summary |
|---|---|
| public int size() Get the degree of this row value expression. | |