diff --git a/jOOQ-website/src/main/resources/manual-3.0.xml b/jOOQ-website/src/main/resources/manual-3.0.xml index be484d6fb1..06a882e60f 100644 --- a/jOOQ-website/src/main/resources/manual-3.0.xml +++ b/jOOQ-website/src/main/resources/manual-3.0.xml @@ -2340,8 +2340,17 @@ create.selectFrom(AUTHOR) .from(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 + 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:

+ + + + + diff --git a/jOOQ/src/main/java/org/jooq/SelectFromStep.java b/jOOQ/src/main/java/org/jooq/SelectFromStep.java index f3fbb6280d..d4818ed64b 100644 --- a/jOOQ/src/main/java/org/jooq/SelectFromStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectFromStep.java @@ -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 extends SelectWhereStep { * create.select(field1, field2) * .hint("/*+ALL_ROWS*/") * .from(table1) - * .execute(); + * .fetch(); + * + *

+ * 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 + * SQL_CALC_FOUND_ROWS option:

+     * create.select(field1, field2)
+     *       .hint("SQL_CALC_FOUND_ROWS")
+     *       .from(table1)
+     *       .fetch();
+     * 
+ *

+ * The outcome of such a query is this:

+     * SELECT [hint] field1, field2 FROM table1
      * 
*

* For SQL Server style table hints, see {@link Table#with(String)} * * @see Table#with(String) + * @see SelectQuery#addHint(String) */ - @Support({ CUBRID, ORACLE }) + @Support SelectFromStep hint(String hint); } diff --git a/jOOQ/src/main/java/org/jooq/SelectQuery.java b/jOOQ/src/main/java/org/jooq/SelectQuery.java index c557374191..565afbf0dc 100644 --- a/jOOQ/src/main/java/org/jooq/SelectQuery.java +++ b/jOOQ/src/main/java/org/jooq/SelectQuery.java @@ -259,11 +259,24 @@ public interface SelectQuery extends SimpleSelectQuery { * .execute(); * *

+ * 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 + * SQL_CALC_FOUND_ROWS option:

+     * create.select(field1, field2)
+     *       .hint("SQL_CALC_FOUND_ROWS")
+     *       .from(table1)
+     *       .fetch();
+     * 
+ *

+ * The outcome of such a query is this:

+     * SELECT [hint] field1, field2 FROM table1
+     * 
+ *

* For SQL Server style table hints, see {@link Table#with(String)} * * @see Table#with(String) */ - @Support({ CUBRID, ORACLE }) + @Support void addHint(String hint); /**