[#1967] Document using MySQL's SQL_CALC_FOUND_ROWS as an Oracle hint
This commit is contained in:
parent
f489e76f61
commit
c303a019bd
@ -2340,8 +2340,17 @@ create.selectFrom(AUTHOR)
|
||||
.from(AUTHOR);</java>
|
||||
|
||||
<p>
|
||||
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
|
||||
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. This can be useful in other databases too, such as MySQL, for instance:
|
||||
</p>
|
||||
|
||||
<code-pair>
|
||||
<sql><![CDATA[SELECT SQL_CALC_FOUND_ROWS field1, field2
|
||||
FROM table1
|
||||
]]></sql>
|
||||
<java><![CDATA[create.select(field1, field2)
|
||||
.hint("SQL_CALC_FOUND_ROWS")
|
||||
.from(table1)]]></java>
|
||||
</code-pair>
|
||||
</content>
|
||||
</section>
|
||||
</sections>
|
||||
|
||||
@ -35,9 +35,6 @@
|
||||
*/
|
||||
package org.jooq;
|
||||
|
||||
import static org.jooq.SQLDialect.CUBRID;
|
||||
import static org.jooq.SQLDialect.ORACLE;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.jooq.impl.Factory;
|
||||
@ -146,13 +143,27 @@ public interface SelectFromStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* create.select(field1, field2)
|
||||
* .hint("/*+ALL_ROWS*/")
|
||||
* .from(table1)
|
||||
* .execute();
|
||||
* .fetch();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* You can also use this clause for any other database, that accepts hints
|
||||
* or options at the same syntactic location, e.g. for MySQL's
|
||||
* <code>SQL_CALC_FOUND_ROWS</code> option: <code><pre>
|
||||
* create.select(field1, field2)
|
||||
* .hint("SQL_CALC_FOUND_ROWS")
|
||||
* .from(table1)
|
||||
* .fetch();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* The outcome of such a query is this: <code><pre>
|
||||
* SELECT [hint] field1, field2 FROM table1
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* For SQL Server style table hints, see {@link Table#with(String)}
|
||||
*
|
||||
* @see Table#with(String)
|
||||
* @see SelectQuery#addHint(String)
|
||||
*/
|
||||
@Support({ CUBRID, ORACLE })
|
||||
@Support
|
||||
SelectFromStep<R> hint(String hint);
|
||||
}
|
||||
|
||||
@ -259,11 +259,24 @@ public interface SelectQuery extends SimpleSelectQuery<Record> {
|
||||
* .execute();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* You can also use this clause for any other database, that accepts hints
|
||||
* or options at the same syntactic location, e.g. for MySQL's
|
||||
* <code>SQL_CALC_FOUND_ROWS</code> option: <code><pre>
|
||||
* create.select(field1, field2)
|
||||
* .hint("SQL_CALC_FOUND_ROWS")
|
||||
* .from(table1)
|
||||
* .fetch();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* The outcome of such a query is this: <code><pre>
|
||||
* SELECT [hint] field1, field2 FROM table1
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* For SQL Server style table hints, see {@link Table#with(String)}
|
||||
*
|
||||
* @see Table#with(String)
|
||||
*/
|
||||
@Support({ CUBRID, ORACLE })
|
||||
@Support
|
||||
void addHint(String hint);
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user