Select's DSL API when selecting generic
Record types.
Example:
-- get all authors' first and last names, and the number
-- of books they've written in German, if they have written
-- more than five books in German in the last three years
-- (from 2011), and sort those authors by last names
-- limiting results to the second and third row
SELECT T_AUTHOR.FIRST_NAME, T_AUTHOR.LAST_NAME, COUNT(*)
FROM T_AUTHOR
JOIN T_BOOK ON T_AUTHOR.ID = T_BOOK.AUTHOR_ID
WHERE T_BOOK.LANGUAGE = 'DE'
AND T_BOOK.PUBLISHED > '2008-01-01'
GROUP BY T_AUTHOR.FIRST_NAME, T_AUTHOR.LAST_NAME
HAVING COUNT(*) > 5
ORDER BY T_AUTHOR.LAST_NAME ASC NULLS FIRST
LIMIT 2
OFFSET 1
FOR UPDATE
OF FIRST_NAME, LAST_NAME
NO WAIT
Its equivalent in jOOQ
create.select(TAuthor.FIRST_NAME, TAuthor.LAST_NAME, create.count())
.from(T_AUTHOR)
.join(T_BOOK).on(TBook.AUTHOR_ID.equal(TAuthor.ID))
.where(TBook.LANGUAGE.equal("DE"))
.and(TBook.PUBLISHED.greaterThan(parseDate('2008-01-01')))
.groupBy(TAuthor.FIRST_NAME, TAuthor.LAST_NAME)
.having(create.count().greaterThan(5))
.orderBy(TAuthor.LAST_NAME.asc().nullsFirst())
.limit(2)
.offset(1)
.forUpdate()
.of(TAuthor.FIRST_NAME, TAuthor.LAST_NAME)
.noWait();
Refer to the manual for more details
XYZ*Step types directly from client code
It is usually not recommended to reference any XYZ*Step types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step types directly:
| Modifier and Type | Method and Description |
|---|---|
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | crossJoin(TableLike<?> table)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectJoinStep | crossJoin(SQL sql)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectJoinStep | crossJoin(String sql)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectJoinStep | crossJoin(String sql, Object... bindings)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectJoinStep | crossJoin(String sql, QueryPart... parts)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectJoinStep | crossJoin(Name name)
Convenience method to
If this syntax is unavailable, it is emulated with a regular
|
| public @NotNull SelectOnStep | fullJoin(TableLike<?> table)
Convenience method to |
| public @NotNull SelectOnStep | fullJoin(SQL sql)
Convenience method to |
| public @NotNull SelectOnStep | fullJoin(String sql)
Convenience method to |
| public @NotNull SelectOnStep | fullJoin(String sql, Object... bindings)
Convenience method to |
| public @NotNull SelectOnStep | fullJoin(String sql, QueryPart... parts)
Convenience method to |
| public @NotNull SelectOnStep | fullJoin(Name name)
Convenience method to |
| public @NotNull SelectOnStep | fullOuterJoin(TableLike<?> table)
Convenience method to This is only possible where the underlying RDBMS supports it |
| public @NotNull SelectOnStep | fullOuterJoin(SQL sql)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectOnStep | fullOuterJoin(String sql)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectOnStep | fullOuterJoin(String sql, Object... bindings)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectOnStep | fullOuterJoin(String sql, QueryPart... parts)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectOnStep | fullOuterJoin(Name name)
Convenience method to This is only possible where the underlying RDBMS supports it |
| public @NotNull SelectOnStep | innerJoin(TableLike<?> table)
Convenience method to |
| public @NotNull SelectOnStep | innerJoin(SQL sql)
Convenience method to |
| public @NotNull SelectOnStep | innerJoin(String sql)
Convenience method to |
| public @NotNull SelectOnStep | innerJoin(String sql, Object... bindings)
Convenience method to |
| public @NotNull SelectOnStep | innerJoin(String sql, QueryPart... parts)
Convenience method to |
| public @NotNull SelectOnStep | innerJoin(Name name)
Convenience method to |
| public @NotNull SelectOptionalOnStep | join(TableLike<?> table, JoinType type)
Convenience method to join a table to the last table added to the
Depending on the |
| public @NotNull SelectOnStep | join(TableLike<?> table)
Convenience method to |
| public @NotNull SelectOnStep | join(SQL sql)
Convenience method to |
| public @NotNull SelectOnStep | join(String sql)
Convenience method to |
| public @NotNull SelectOnStep | join(String sql, Object... bindings)
Convenience method to |
| public @NotNull SelectOnStep | join(String sql, QueryPart... parts)
Convenience method to |
| public @NotNull SelectOnStep | join(Name name)
Convenience method to |
| public @NotNull SelectOnStep | leftAntiJoin(TableLike<?> table)
A synthetic |
| public @NotNull SelectJoinPartitionByStep | leftJoin(TableLike<?> table)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftJoin(SQL sql)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftJoin(String sql)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftJoin(String sql, Object... bindings)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftJoin(String sql, QueryPart... parts)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftJoin(Name name)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(TableLike<?> table)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(SQL sql)
Convenience method to Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(String sql)
Convenience method to Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(String sql, Object... bindings)
Convenience method to Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(String sql, QueryPart... parts)
Convenience method to Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | leftOuterJoin(Name name)
Convenience method to |
| public @NotNull SelectOnStep | leftSemiJoin(TableLike<?> table)
A synthetic |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(TableLike<?> table)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(SQL sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(String sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(String sql, Object... bindings)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(String sql, QueryPart... parts)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalFullOuterJoin(Name name)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(TableLike<?> table)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(SQL sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(String sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(String sql, Object... bindings)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(String sql, QueryPart... parts)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalJoin(Name name)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(TableLike<?> table)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(SQL sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(String sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(String sql, Object... bindings)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(String sql, QueryPart... parts)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalLeftOuterJoin(Name name)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(TableLike<?> table)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(SQL sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(String sql)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(String sql, Object... bindings)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(String sql, QueryPart... parts)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | naturalRightOuterJoin(Name name)
Convenience method to Natural joins are supported by most RDBMS. |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinStep | |
| public @NotNull SelectJoinPartitionByStep | rightJoin(TableLike<?> table)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightJoin(SQL sql)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightJoin(String sql)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightJoin(String sql, Object... bindings)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightJoin(String sql, QueryPart... parts)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightJoin(Name name)
Convenience method to |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(TableLike<?> table)
Convenience method to This is only possible where the underlying RDBMS supports it |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(SQL sql)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(String sql)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(String sql, Object... bindings)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(String sql, QueryPart... parts)
Convenience method to This is only possible where the underlying RDBMS supports it Note When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. |
| public @NotNull SelectJoinPartitionByStep | rightOuterJoin(Name name)
Convenience method to This is only possible where the underlying RDBMS supports it |
| public @NotNull SelectOnStep | |
| public @NotNull SelectOnStep | |
| public @NotNull SelectOnStep | |
| public @NotNull SelectOnStep | |
| public @NotNull SelectOnStep | |
| public @NotNull SelectOnStep |