diff --git a/jOOQ/src/main/java/org/jooq/WindowExcludeStep.java b/jOOQ/src/main/java/org/jooq/WindowExcludeStep.java new file mode 100644 index 0000000000..21c9fd45c2 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/WindowExcludeStep.java @@ -0,0 +1,96 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq; + +// ... +// ... +// ... +import static org.jooq.SQLDialect.MARIADB; +import static org.jooq.SQLDialect.MYSQL_8_0; +// ... +import static org.jooq.SQLDialect.POSTGRES; +import static org.jooq.SQLDialect.POSTGRES_11; +// ... +// ... +// ... +// ... +// ... +// ... + +/** + * This type is used for the window function DSL API. + *
+ * Example:
+ * Example:
+ *
+ * It is usually not recommended to reference any
+ * Drawbacks of referencing the
+ *
+ * @param
+ * field.firstValue()
+ * .ignoreNulls()
+ * .over()
+ * .partitionBy(AUTHOR_ID)
+ * .orderBy(PUBLISHED_IN.asc())
+ * .rowsBetweenUnboundedPreceding()
+ * .andUnboundedFollowing()
+ *
EXCLUDE CURRENT ROW clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowFinalStepEXCLUDE GROUP clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowFinalStepEXCLUDE TIES clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowFinalStepEXCLUDE NO OTHERS clause.
+ */
+ @Support({ MARIADB, MYSQL_8_0, POSTGRES })
+ WindowFinalStep... AND [number] PRECEDING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStep... AND CURRENT ROW frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStep... AND UNBOUNDED FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStep... AND [number] FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepROWS [number] PRECEDING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepROWS CURRENT ROW frame clause to the window function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepROWS UNBOUNDED FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepROWS [number] FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepROWS BETWEEN UNBOUNDED PRECEDING ... frame clause to
@@ -144,34 +144,34 @@ public interface WindowRowsStepRANGE [number] PRECEDING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepRANGE CURRENT ROW frame clause to the window function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepRANGE UNBOUNDED FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepRANGE [number] FOLLOWING frame clause to the window
* function.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowFinalStepRANGE BETWEEN UNBOUNDED PRECEDING ... frame clause to
@@ -213,34 +213,34 @@ public interface WindowRowsStepGROUPS [number] PRECEDING frame clause to the window
* function.
*/
@Support({ POSTGRES_11 })
- WindowFinalStepGROUPS CURRENT ROW frame clause to the window function.
*/
@Support({ POSTGRES_11 })
- WindowFinalStepGROUPS UNBOUNDED FOLLOWING frame clause to the window
* function.
*/
@Support({ POSTGRES_11 })
- WindowFinalStepGROUPS [number] FOLLOWING frame clause to the window
* function.
*/
@Support({ POSTGRES_11 })
- WindowFinalStepGROUPS BETWEEN UNBOUNDED PRECEDING ... frame clause to
diff --git a/jOOQ/src/main/java/org/jooq/WindowSpecificationExcludeStep.java b/jOOQ/src/main/java/org/jooq/WindowSpecificationExcludeStep.java
new file mode 100644
index 0000000000..951916743b
--- /dev/null
+++ b/jOOQ/src/main/java/org/jooq/WindowSpecificationExcludeStep.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Other licenses:
+ * -----------------------------------------------------------------------------
+ * Commercial licenses for this work are available. These replace the above
+ * ASL 2.0 and offer limited warranties, support, maintenance, and commercial
+ * database integrations.
+ *
+ * For more information, please visit: http://www.jooq.org/licenses
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+package org.jooq;
+
+// ...
+// ...
+// ...
+import static org.jooq.SQLDialect.MARIADB;
+import static org.jooq.SQLDialect.MYSQL_8_0;
+// ...
+import static org.jooq.SQLDialect.POSTGRES;
+import static org.jooq.SQLDialect.POSTGRES_11;
+// ...
+// ...
+// ...
+// ...
+// ...
+// ...
+
+/**
+ * An intermediate step in the construction of a {@link WindowSpecification}.
+ *
+ *
+ * WindowSpecification spec =
+ * DSL.partitionBy(BOOK.AUTHOR_ID)
+ * .orderBy(BOOK.ID)
+ * .rowsBetweenUnboundedPreceding()
+ * .andCurrentRow();
+ *
Referencing
+ * XYZ*Step types directly from client codeXYZ*Step types
+ * directly from client code, or assign them to local variables. When writing
+ * dynamic SQL, creating a statement's components dynamically, and passing them
+ * to the DSL API statically is usually a better choice. See the manual's
+ * section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
+ * XYZ*Step types directly:
+ *
+ *
+ *
+ * @author Lukas Eder
+ */
+public interface WindowSpecificationExcludeStep extends WindowSpecificationFinalStep {
+
+ /**
+ * Add an EXCLUDE CURRENT ROW clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowSpecificationFinalStep excludeCurrentRow();
+
+ /**
+ * Add an EXCLUDE GROUP clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowSpecificationFinalStep excludeGroup();
+
+ /**
+ * Add an EXCLUDE TIES clause.
+ */
+ @Support({ POSTGRES_11 })
+ WindowSpecificationFinalStep excludeTies();
+
+ /**
+ * Add an EXCLUDE NO OTHERS clause.
+ */
+ @Support({ MARIADB, MYSQL_8_0, POSTGRES })
+ WindowSpecificationFinalStep excludeNoOthers();
+}
diff --git a/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsAndStep.java b/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsAndStep.java
index 7ffc2cb343..147528ac0f 100644
--- a/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsAndStep.java
+++ b/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsAndStep.java
@@ -89,34 +89,34 @@ public interface WindowSpecificationRowsAndStep {
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep andUnboundedPreceding();
+ WindowSpecificationExcludeStep andUnboundedPreceding();
/**
* Add a ... AND [number] PRECEDING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep andPreceding(int number);
+ WindowSpecificationExcludeStep andPreceding(int number);
/**
* Add a ... AND CURRENT ROW frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep andCurrentRow();
+ WindowSpecificationExcludeStep andCurrentRow();
/**
* Add a ... AND UNBOUNDED FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep andUnboundedFollowing();
+ WindowSpecificationExcludeStep andUnboundedFollowing();
/**
* Add a ... AND [number] FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep andFollowing(int number);
+ WindowSpecificationExcludeStep andFollowing(int number);
}
diff --git a/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsStep.java b/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsStep.java
index 975db2e779..520166bfc2 100644
--- a/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsStep.java
+++ b/jOOQ/src/main/java/org/jooq/WindowSpecificationRowsStep.java
@@ -90,35 +90,35 @@ public interface WindowSpecificationRowsStep extends WindowSpecificationFinalSte
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rowsUnboundedPreceding();
+ WindowSpecificationExcludeStep rowsUnboundedPreceding();
/**
* Add a ROWS [number] PRECEDING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rowsPreceding(int number);
+ WindowSpecificationExcludeStep rowsPreceding(int number);
/**
* Add a ROWS CURRENT ROW frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rowsCurrentRow();
+ WindowSpecificationExcludeStep rowsCurrentRow();
/**
* Add a ROWS UNBOUNDED FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rowsUnboundedFollowing();
+ WindowSpecificationExcludeStep rowsUnboundedFollowing();
/**
* Add a ROWS [number] FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rowsFollowing(int number);
+ WindowSpecificationExcludeStep rowsFollowing(int number);
/**
* Add a ROWS BETWEEN UNBOUNDED PRECEDING ... frame clause to
@@ -160,35 +160,35 @@ public interface WindowSpecificationRowsStep extends WindowSpecificationFinalSte
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rangeUnboundedPreceding();
+ WindowSpecificationExcludeStep rangeUnboundedPreceding();
/**
* Add a RANGE [number] PRECEDING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rangePreceding(int number);
+ WindowSpecificationExcludeStep rangePreceding(int number);
/**
* Add a RANGE CURRENT ROW frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rangeCurrentRow();
+ WindowSpecificationExcludeStep rangeCurrentRow();
/**
* Add a RANGE UNBOUNDED FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rangeUnboundedFollowing();
+ WindowSpecificationExcludeStep rangeUnboundedFollowing();
/**
* Add a RANGE [number] FOLLOWING frame clause to the window
* specification.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- WindowSpecificationFinalStep rangeFollowing(int number);
+ WindowSpecificationExcludeStep rangeFollowing(int number);
/**
* Add a RANGE BETWEEN UNBOUNDED PRECEDING ... frame clause to
@@ -230,35 +230,35 @@ public interface WindowSpecificationRowsStep extends WindowSpecificationFinalSte
* specification.
*/
@Support({ POSTGRES_11 })
- WindowSpecificationFinalStep groupsUnboundedPreceding();
+ WindowSpecificationExcludeStep groupsUnboundedPreceding();
/**
* Add a GROUPS [number] PRECEDING frame clause to the window
* specification.
*/
@Support({ POSTGRES_11 })
- WindowSpecificationFinalStep groupsPreceding(int number);
+ WindowSpecificationExcludeStep groupsPreceding(int number);
/**
* Add a GROUPS CURRENT ROW frame clause to the window
* specification.
*/
@Support({ POSTGRES_11 })
- WindowSpecificationFinalStep groupsCurrentRow();
+ WindowSpecificationExcludeStep groupsCurrentRow();
/**
* Add a GROUPS UNBOUNDED FOLLOWING frame clause to the window
* specification.
*/
@Support({ POSTGRES_11 })
- WindowSpecificationFinalStep groupsUnboundedFollowing();
+ WindowSpecificationExcludeStep groupsUnboundedFollowing();
/**
* Add a GROUPS [number] FOLLOWING frame clause to the window
* specification.
*/
@Support({ POSTGRES_11 })
- WindowSpecificationFinalStep groupsFollowing(int number);
+ WindowSpecificationExcludeStep groupsFollowing(int number);
/**
* Add a GROUPS BETWEEN UNBOUNDED PRECEDING ... frame clause to
diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java
index 0768afad0a..55ed1e52de 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DSL.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java
@@ -318,7 +318,7 @@ import org.jooq.WindowFromFirstLastStep;
import org.jooq.WindowIgnoreNullsStep;
import org.jooq.WindowOverStep;
import org.jooq.WindowSpecification;
-import org.jooq.WindowSpecificationFinalStep;
+import org.jooq.WindowSpecificationExcludeStep;
import org.jooq.WindowSpecificationOrderByStep;
import org.jooq.WindowSpecificationRowsAndStep;
import org.jooq.WindowSpecificationRowsStep;
@@ -17560,7 +17560,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a ROWS clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rowsUnboundedPreceding() {
+ public static WindowSpecificationExcludeStep rowsUnboundedPreceding() {
return new WindowSpecificationImpl().rowsUnboundedPreceding();
}
@@ -17568,7 +17568,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a ROWS clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rowsPreceding(int number) {
+ public static WindowSpecificationExcludeStep rowsPreceding(int number) {
return new WindowSpecificationImpl().rowsPreceding(number);
}
@@ -17576,7 +17576,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a ROWS clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rowsCurrentRow() {
+ public static WindowSpecificationExcludeStep rowsCurrentRow() {
return new WindowSpecificationImpl().rowsCurrentRow();
}
@@ -17584,7 +17584,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a ROWS clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rowsUnboundedFollowing() {
+ public static WindowSpecificationExcludeStep rowsUnboundedFollowing() {
return new WindowSpecificationImpl().rowsUnboundedFollowing();
}
@@ -17592,7 +17592,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a ROWS clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rowsFollowing(int number) {
+ public static WindowSpecificationExcludeStep rowsFollowing(int number) {
return new WindowSpecificationImpl().rowsFollowing(number);
}
@@ -17640,7 +17640,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a RANGE clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rangeUnboundedPreceding() {
+ public static WindowSpecificationExcludeStep rangeUnboundedPreceding() {
return new WindowSpecificationImpl().rangeUnboundedPreceding();
}
@@ -17648,7 +17648,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a RANGE clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rangePreceding(int number) {
+ public static WindowSpecificationExcludeStep rangePreceding(int number) {
return new WindowSpecificationImpl().rangePreceding(number);
}
@@ -17656,7 +17656,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a RANGE clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rangeCurrentRow() {
+ public static WindowSpecificationExcludeStep rangeCurrentRow() {
return new WindowSpecificationImpl().rangeCurrentRow();
}
@@ -17664,7 +17664,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a RANGE clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rangeUnboundedFollowing() {
+ public static WindowSpecificationExcludeStep rangeUnboundedFollowing() {
return new WindowSpecificationImpl().rangeUnboundedFollowing();
}
@@ -17672,7 +17672,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a RANGE clause.
*/
@Support({ MARIADB, MYSQL_8_0, POSTGRES })
- public static WindowSpecificationFinalStep rangeFollowing(int number) {
+ public static WindowSpecificationExcludeStep rangeFollowing(int number) {
return new WindowSpecificationImpl().rangeFollowing(number);
}
@@ -17720,7 +17720,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a GROUPS clause.
*/
@Support({ POSTGRES_11 })
- public static WindowSpecificationFinalStep groupsUnboundedPreceding() {
+ public static WindowSpecificationExcludeStep groupsUnboundedPreceding() {
return new WindowSpecificationImpl().groupsUnboundedPreceding();
}
@@ -17728,7 +17728,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a GROUPS clause.
*/
@Support({ POSTGRES_11 })
- public static WindowSpecificationFinalStep groupsPreceding(int number) {
+ public static WindowSpecificationExcludeStep groupsPreceding(int number) {
return new WindowSpecificationImpl().groupsPreceding(number);
}
@@ -17736,7 +17736,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a GROUPS clause.
*/
@Support({ POSTGRES_11 })
- public static WindowSpecificationFinalStep groupsCurrentRow() {
+ public static WindowSpecificationExcludeStep groupsCurrentRow() {
return new WindowSpecificationImpl().groupsCurrentRow();
}
@@ -17744,7 +17744,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a GROUPS clause.
*/
@Support({ POSTGRES_11 })
- public static WindowSpecificationFinalStep groupsUnboundedFollowing() {
+ public static WindowSpecificationExcludeStep groupsUnboundedFollowing() {
return new WindowSpecificationImpl().groupsUnboundedFollowing();
}
@@ -17752,7 +17752,7 @@ public class DSL {
* Create a {@link WindowSpecification} with a GROUPS clause.
*/
@Support({ POSTGRES_11 })
- public static WindowSpecificationFinalStep groupsFollowing(int number) {
+ public static WindowSpecificationExcludeStep groupsFollowing(int number) {
return new WindowSpecificationImpl().groupsFollowing(number);
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/Function.java b/jOOQ/src/main/java/org/jooq/impl/Function.java
index 11f5634b4b..baa78c9386 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Function.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Function.java
@@ -98,6 +98,7 @@ import org.jooq.SQL;
import org.jooq.SQLDialect;
import org.jooq.WindowBeforeOverStep;
import org.jooq.WindowDefinition;
+import org.jooq.WindowExcludeStep;
import org.jooq.WindowFinalStep;
import org.jooq.WindowFromFirstLastStep;
import org.jooq.WindowIgnoreNullsStep;
@@ -125,7 +126,8 @@ class Function