From e914d2d0376a7986ec3a434035e8df6f656be509 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 3 Mar 2012 13:17:29 +0000 Subject: [PATCH] Documented descending ordering by index --- jOOQ/src/main/java/org/jooq/OrderProvider.java | 17 +++++++++++------ .../main/java/org/jooq/SelectOrderByStep.java | 4 ++++ .../java/org/jooq/SimpleSelectOrderByStep.java | 4 ++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/OrderProvider.java b/jOOQ/src/main/java/org/jooq/OrderProvider.java index 44454d3b4b..c1cb108b04 100644 --- a/jOOQ/src/main/java/org/jooq/OrderProvider.java +++ b/jOOQ/src/main/java/org/jooq/OrderProvider.java @@ -84,6 +84,10 @@ public interface OrderProvider { * Adds ordering fields *

* Indexes start at 1 in SQL! + *

+ * Note, you can use addOrderBy(Factory.val(1).desc()) or + * addOrderBy(Factory.literal(1).desc()) to apply descending + * ordering * * @param fieldIndexes The ordering fields */ @@ -108,8 +112,9 @@ public interface OrderProvider { *

* If there is no LIMIT or TOP clause in your * RDBMS, or the LIMIT or TOP clause does not - * support bind values, this may be simulated with a ROW_NUMBER() - * window function and nested SELECT statements. + * support bind values, this may be simulated with a + * ROW_NUMBER() window function and nested SELECT + * statements. *

* This is the same as calling {@link #addLimit(int, int)} with offset = 0 * @@ -144,8 +149,8 @@ public interface OrderProvider { * If there is no LIMIT or TOP clause in your * RDBMS, or the LIMIT or TOP clause does not * support bind values, or if your RDBMS does not natively support offsets, - * this may be simulated with a ROW_NUMBER() window function and - * nested SELECT statements. + * this may be simulated with a ROW_NUMBER() window function + * and nested SELECT statements. * * @param offset The lowest offset starting at 0 * @param numberOfRows The number of rows to return @@ -162,8 +167,8 @@ public interface OrderProvider { * If there is no LIMIT or TOP clause in your * RDBMS, or the LIMIT or TOP clause does not * support bind values, or if your RDBMS does not natively support offsets, - * this may be simulated with a ROW_NUMBER() window function and - * nested SELECT statements. + * this may be simulated with a ROW_NUMBER() window function + * and nested SELECT statements. * * @param offset The lowest offset starting at 0 * @param numberOfRows The number of rows to return diff --git a/jOOQ/src/main/java/org/jooq/SelectOrderByStep.java b/jOOQ/src/main/java/org/jooq/SelectOrderByStep.java index 4b1ad7c989..a4a7013ea6 100644 --- a/jOOQ/src/main/java/org/jooq/SelectOrderByStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectOrderByStep.java @@ -103,6 +103,10 @@ public interface SelectOrderByStep extends SelectLimitStep { * Add an ORDER BY clause to the query *

* Indexes start at 1 in SQL! + *

+ * Note, you can use orderBy(Factory.val(1).desc()) or + * orderBy(Factory.literal(1).desc()) to apply descending + * ordering */ @Support SelectLimitStep orderBy(int... fieldIndexes); diff --git a/jOOQ/src/main/java/org/jooq/SimpleSelectOrderByStep.java b/jOOQ/src/main/java/org/jooq/SimpleSelectOrderByStep.java index 7c24374911..2333e9a0f8 100644 --- a/jOOQ/src/main/java/org/jooq/SimpleSelectOrderByStep.java +++ b/jOOQ/src/main/java/org/jooq/SimpleSelectOrderByStep.java @@ -80,6 +80,10 @@ public interface SimpleSelectOrderByStep extends SimpleSelectL * Add an ORDER BY clause to the query *

* Indexes start at 1 in SQL! + *

+ * Note, you can use orderBy(Factory.val(1).desc()) or + * orderBy(Factory.literal(1).desc()) to apply descending + * ordering */ @Support SimpleSelectLimitStep orderBy(int... fieldIndexes);