From 11e59a8ed7821a745e2a2cb3bfa18f5249f28ef2 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 14 Oct 2021 14:05:55 +0200 Subject: [PATCH] [jOOQ/jOOQ#12492] Clarify whether .offset(..) starts from 0 or 1 --- jOOQ/src/main/java/org/jooq/SelectLimitStep.java | 13 ++++++++++--- jOOQ/src/main/java/org/jooq/SelectOffsetStep.java | 13 ++++++++++--- jOOQ/src/main/java/org/jooq/SelectQuery.java | 13 ++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/SelectLimitStep.java b/jOOQ/src/main/java/org/jooq/SelectLimitStep.java index 2e33fdd6ee..254ecc32ed 100644 --- a/jOOQ/src/main/java/org/jooq/SelectLimitStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectLimitStep.java @@ -290,7 +290,9 @@ public interface SelectLimitStep extends SelectForUpdateStep limit(Param offset, Param numberOfRows); /** - * Add an OFFSET clause to the query + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -302,7 +304,9 @@ public interface SelectLimitStep extends SelectForUpdateStep offset(int offset); /** - * Add an OFFSET clause to the query + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -314,7 +318,10 @@ public interface SelectLimitStep extends SelectForUpdateStep offset(Number offset); /** - * Add an OFFSET clause to the query using a named parameter + * Add a 0-based OFFSET clause to the query using a named + * parameter + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is diff --git a/jOOQ/src/main/java/org/jooq/SelectOffsetStep.java b/jOOQ/src/main/java/org/jooq/SelectOffsetStep.java index 75026c22b4..c426166c0f 100644 --- a/jOOQ/src/main/java/org/jooq/SelectOffsetStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectOffsetStep.java @@ -133,7 +133,9 @@ import static org.jooq.SQLDialect.YUGABYTE; public interface SelectOffsetStep extends SelectForUpdateStep { /** - * Add an OFFSET clause to the query. + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -145,7 +147,9 @@ public interface SelectOffsetStep extends SelectForUpdateStep< SelectForUpdateStep offset(int offset); /** - * Add an OFFSET clause to the query. + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -157,7 +161,10 @@ public interface SelectOffsetStep extends SelectForUpdateStep< SelectForUpdateStep offset(Number offset); /** - * Add an OFFSET clause to the query using a named parameter. + * Add a 0-based OFFSET clause to the query using a named + * parameter. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is diff --git a/jOOQ/src/main/java/org/jooq/SelectQuery.java b/jOOQ/src/main/java/org/jooq/SelectQuery.java index e0dd8b9644..bf55c1f062 100644 --- a/jOOQ/src/main/java/org/jooq/SelectQuery.java +++ b/jOOQ/src/main/java/org/jooq/SelectQuery.java @@ -684,7 +684,9 @@ public interface SelectQuery extends Select, ConditionProvi void addSeekBefore(Collection> fields); /** - * Add an OFFSET clause to the query. + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -695,7 +697,9 @@ public interface SelectQuery extends Select, ConditionProvi void addOffset(int offset); /** - * Add an OFFSET clause to the query. + * Add a 0-based OFFSET clause to the query. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is @@ -706,7 +710,10 @@ public interface SelectQuery extends Select, ConditionProvi void addOffset(Number offset); /** - * Add an OFFSET clause to the query using a named parameter. + * Add a 0-based OFFSET clause to the query using a named + * parameter. + *

+ * Offsets are 0-based as they describe the number of rows to skip. *

* If there is no LIMIT .. OFFSET or TOP clause in * your RDBMS, or if your RDBMS does not natively support offsets, this is