This version of the manual is outdated. For the latest version, follow this link: http://www.jooq.org/doc/3.0/manual.

The jOOQ User Manual. Multiple Pages : Advanced topics : Adding Oracle hints to queriesprevious : next

# How to embed Oracle hints in SELECT

If you are closely coupling your application to an Oracle (or CUBRID) database, you might need to be able to pass hints of the form /*+HINT*/ with your SQL statements to the Oracle database. For example:

SELECT /*+ALL_ROWS*/ FIRST_NAME, LAST_NAME
  FROM T_AUTHOR

This can be done in jOOQ using the .hint() clause in your SELECT statement:

create.select(FIRST_NAME, LAST_NAME)
      .hint("/*+ALL_ROWS*/")
      .from(T_AUTHOR);

Note that you can pass any string in the .hint() clause. If you use that clause, the passed string will always be put in between the SELECT [DISTINCT] keywords and the actual projection list


The jOOQ User Manual. Multiple Pages : Advanced topics : Adding Oracle hints to queriesprevious : next

Fork me on GitHub
The jOOQ Logo