diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java
index 210334d17f..6228cbd7ad 100644
--- a/jOOQ/src/main/java/org/jooq/DSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/DSLContext.java
@@ -3899,6 +3899,22 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep with(String alias, String... fieldAliases);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ *
+ * The
+ * The
+ * Reusable {@link CommonTableExpression} types can be constructed through
+ *
+ * The
+ * The
+ * The
+ * Reusable {@link CommonTableExpression} types can be constructed through
+ *
+ * The
+ * Reusable {@link CommonTableExpression} types can be constructed through
+ *
+ * The
+ * The
+ * Reusable {@link CommonTableExpression} types can be constructed through
+ *
+ * The
+ * The
+ * Note that the {@link SQLDialect#H2} database only supports single-table,
+ *
+ * The
+ * Reusable {@link CommonTableExpression} types can be constructed through
+ *
+ * The
+ * Note that the {@link SQLDialect#H2} database only supports single-table,
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(String, String...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(String, String...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep with(String alias, CollectionWITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -3931,6 +3947,22 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep with(Name alias, Name... fieldAliases);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(Name, Name...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(Name, Name...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep with(Name alias, Collection extends Name> fieldAliases);
+
/**
* Create a WITH clause to supply subsequent
@@ -4703,6 +4735,30 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithStep with(CommonTableExpression>... tables);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ *
+ *
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(CommonTableExpression...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithStep with(Collection extends CommonTableExpression>> tables);
+
/**
* Create a WITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -4735,6 +4791,22 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep withRecursive(String alias, String... fieldAliases);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(String, String...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(String, String...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep withRecursive(String alias, CollectionWITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -4767,6 +4839,22 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep withRecursive(Name alias, Name... fieldAliases);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(Name, Name...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(Name, Name...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep withRecursive(Name alias, Collection extends Name> fieldAliases);
+
/**
* Create a WITH clause to supply subsequent
@@ -5541,6 +5629,30 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithStep withRecursive(CommonTableExpression>... tables);
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ *
+ *
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(CommonTableExpression...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithStep withRecursive(Collection extends CommonTableExpression>> tables);
+
/**
* Create a new DSL select statement, projecting the known columns from a
* table.
diff --git a/jOOQ/src/main/java/org/jooq/WithStep.java b/jOOQ/src/main/java/org/jooq/WithStep.java
index bc93a1ce7c..56c30e4cb9 100644
--- a/jOOQ/src/main/java/org/jooq/WithStep.java
+++ b/jOOQ/src/main/java/org/jooq/WithStep.java
@@ -115,6 +115,12 @@ public interface WithStep extends QueryPart {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep with(String alias, String... fieldAliases);
+ /**
+ * Add another common table expression to the WITH clause.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep with(String alias, CollectionWITH clause.
*/
@@ -127,6 +133,12 @@ public interface WithStep extends QueryPart {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithAsStep with(Name alias, Name... fieldAliases);
+ /**
+ * Add another common table expression to the WITH clause.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithAsStep with(Name alias, Collection extends Name> fieldAliases);
+
/**
* Add another common table expression to the WITH clause.
@@ -431,6 +443,20 @@ public interface WithStep extends QueryPart {
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
WithStep with(CommonTableExpression>... tables);
+ /**
+ * Add another common table expression to the WITH clause.
+ *
+ *
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ WithStep with(Collection extends CommonTableExpression>> tables);
+
// -------------------------------------------------------------------------
// XXX Continue with the actual INSERT, UPDATE, DELETE, SELECT statement type
// -------------------------------------------------------------------------
diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java
index 193b27e994..b46f611e38 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DSL.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java
@@ -776,6 +776,24 @@ public class DSL {
return new WithImpl(null, false).with(alias, fieldAliases);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(String, String...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(String, String...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithAsStep with(String alias, CollectionWITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -812,6 +830,24 @@ public class DSL {
return new WithImpl(null, false).with(alias, fieldAliases);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(Name, Name...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(Name, Name...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithAsStep with(Name alias, Collection extends Name> fieldAliases) {
+ return new WithImpl(null, false).with(alias, fieldAliases);
+ }
+
/**
* Create a WITH clause to supply subsequent
@@ -1657,6 +1693,32 @@ public class DSL {
return new WithImpl(null, false).with(tables);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ *
+ *
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(CommonTableExpression...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithStep with(Collection extends CommonTableExpression>> tables) {
+ return new WithImpl(null, false).with(tables);
+ }
+
/**
* Create a WITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -1699,6 +1761,27 @@ public class DSL {
return new WithImpl(null, true).with(alias, fieldAliases);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(String, String...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(String, String...)} for strictly
+ * recursive CTE.
+ * RECURSIVE common table expression lists.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithAsStep withRecursive(String alias, CollectionWITH clause to supply subsequent
* SELECT, UPDATE, INSERT,
@@ -1738,6 +1821,24 @@ public class DSL {
return new WithImpl(null, true).with(alias, fieldAliases);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(Name, Name...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(Name, Name...)} for strictly
+ * recursive CTE.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithAsStep withRecursive(Name alias, Collection extends Name> fieldAliases) {
+ return new WithImpl(null, true).with(alias, fieldAliases);
+ }
+
/**
* Create a WITH clause to supply subsequent
@@ -2590,6 +2691,35 @@ public class DSL {
return new WithImpl(null, true).with(tables);
}
+ /**
+ * Create a WITH clause to supply subsequent
+ * SELECT, UPDATE, INSERT,
+ * DELETE, and MERGE statements with
+ * {@link CommonTableExpression}s.
+ *
+ *
+ * RECURSIVE keyword may be optional or unsupported in some
+ * databases, in case of which it will not be rendered. For optimal database
+ * interoperability and readability, however, it is suggested that you use
+ * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE
+ * and {@link #withRecursive(CommonTableExpression...)} for strictly
+ * recursive CTE.
+ * RECURSIVE common table expression lists.
+ */
+ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
+ public static WithStep withRecursive(Collection extends CommonTableExpression>> tables) {
+ return new WithImpl(null, true).with(tables);
+ }
+
/**
* Create a new DSL select statement, projecting the known columns from a
* table.
diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
index c9b99282d2..3a8b98e991 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
@@ -1592,6 +1592,11 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new WithImpl(configuration(), false).with(alias, fieldAliases);
}
+ @Override
+ public WithAsStep with(String alias, Collection