diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java
index e15d8b2117..b056606107 100644
--- a/jOOQ/src/main/java/org/jooq/DSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/DSLContext.java
@@ -9949,6 +9949,114 @@ public interface DSLContext extends Scope {
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES })
DropSequenceFinalStep dropSequenceIfExists(Sequence> sequence);
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSL#dropTable(String)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTable(String table);
+
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSL#dropTable(Name)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTable(Name table);
+
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSL#dropTable(Table)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTable(Table> table);
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTableIfExists(String)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTableIfExists(String table);
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTableIfExists(Name)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTableIfExists(Name table);
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTableIfExists(Table)
+ */
+ @NotNull
+ @Support
+ DropTableStep dropTableIfExists(Table> table);
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSL#dropTemporaryTable(String)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTable(String table);
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSL#dropTemporaryTable(Name)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTable(Name table);
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSL#dropTemporaryTable(Table)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTable(Table> table);
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTemporaryTableIfExists(String)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTableIfExists(String table);
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTemporaryTableIfExists(Name)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTableIfExists(Name table);
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSL#dropTemporaryTableIfExists(Table)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ DropTableStep dropTemporaryTableIfExists(Table> table);
+
/**
* The DROP VIEW statement.
*
@@ -11081,123 +11189,6 @@ public interface DSLContext extends Scope {
@Support({ H2, MARIADB, POSTGRES })
AlterTableStep alterTableIfExists(Table> table);
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSL#dropTable(String)
- */
- @NotNull
- @Support
- DropTableStep dropTable(String table);
-
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSL#dropTable(Name)
- */
- @NotNull
- @Support
- DropTableStep dropTable(Name table);
-
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSL#dropTable(Table)
- */
- @NotNull
- @Support
- DropTableStep dropTable(Table> table);
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSL#dropTableIfExists(String)
- */
- @NotNull
- @Support
- DropTableStep dropTableIfExists(String table);
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSL#dropTableIfExists(Name)
- */
- @NotNull
- @Support
- DropTableStep dropTableIfExists(Name table);
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSL#dropTableIfExists(Table)
- */
- @NotNull
- @Support
- DropTableStep dropTableIfExists(Table> table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSL#dropTemporaryTable(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTable(String table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSL#dropTemporaryTable(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTable(Name table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSL#dropTemporaryTable(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTable(Table> table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSL#dropTemporaryTableIfExists(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTableIfExists(String table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSL#dropTemporaryTableIfExists(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTableIfExists(Name table);
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSL#dropTemporaryTableIfExists(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- DropTableStep dropTemporaryTableIfExists(Table> table);
-
/**
* Create a new DSL truncate statement.
*
diff --git a/jOOQ/src/main/java/org/jooq/DropTableFinalStep.java b/jOOQ/src/main/java/org/jooq/DropTableFinalStep.java
index 30ae3ad311..4ad1fc2118 100644
--- a/jOOQ/src/main/java/org/jooq/DropTableFinalStep.java
+++ b/jOOQ/src/main/java/org/jooq/DropTableFinalStep.java
@@ -37,9 +37,14 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
+import org.jetbrains.annotations.*;
/**
- * The final step in the DROP TABLE DSL.
+ * A step in the construction of the DROP TABLE statement.
*
*
XYZ*Step types directly from client code@@ -58,9 +63,7 @@ package org.jooq; *
DROP TABLE DSL used to specify DROP
- * behaviour.
+ * A step in the construction of the DROP TABLE statement.
* *
XYZ*Step types directly from client code@@ -62,24 +63,21 @@ import org.jetbrains.annotations.*; *
CASCADE clause to the DROP TABLE
- * statement.
+ * Add the CASCADE clause to the DROP TABLE statement.
*/
- @NotNull
@Support
+ @NotNull
DropTableFinalStep cascade();
/**
- * Add a RESTRICT clause to the DROP TABLE
- * statement.
+ * Add the RESTRICT clause to the DROP TABLE statement.
*/
- @NotNull
@Support
+ @NotNull
DropTableFinalStep restrict();
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/Cascade.java b/jOOQ/src/main/java/org/jooq/impl/Cascade.java
index c961668a33..fdfd0cc68b 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Cascade.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Cascade.java
@@ -42,5 +42,15 @@ package org.jooq.impl;
* @author Lukas Eder
*/
enum Cascade {
- CASCADE, RESTRICT
+ CASCADE,
+ RESTRICT;
+
+ static Cascade of(Boolean b) {
+ if (b == null)
+ return null;
+ else if (b)
+ return CASCADE;
+ else
+ return RESTRICT;
+ }
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java
index 3d6ad3da36..5795f3668a 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DSL.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java
@@ -7997,6 +7997,138 @@ public class DSL {
return dsl().dropSequenceIfExists(sequence);
}
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSLContext#dropTable(String)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTable(String table) {
+ return dsl().dropTable(table);
+ }
+
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSLContext#dropTable(Name)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTable(Name table) {
+ return dsl().dropTable(table);
+ }
+
+ /**
+ * The DROP TABLE statement.
+ *
+ * @see DSLContext#dropTable(Table)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTable(Table> table) {
+ return dsl().dropTable(table);
+ }
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTableIfExists(String)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTableIfExists(String table) {
+ return dsl().dropTableIfExists(table);
+ }
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTableIfExists(Name)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTableIfExists(Name table) {
+ return dsl().dropTableIfExists(table);
+ }
+
+ /**
+ * The DROP TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTableIfExists(Table)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropTableStep dropTableIfExists(Table> table) {
+ return dsl().dropTableIfExists(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSLContext#dropTemporaryTable(String)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTable(String table) {
+ return dsl().dropTemporaryTable(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSLContext#dropTemporaryTable(Name)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTable(Name table) {
+ return dsl().dropTemporaryTable(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE statement.
+ *
+ * @see DSLContext#dropTemporaryTable(Table)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTable(Table> table) {
+ return dsl().dropTemporaryTable(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTemporaryTableIfExists(String)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTableIfExists(String table) {
+ return dsl().dropTemporaryTableIfExists(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTemporaryTableIfExists(Name)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTableIfExists(Name table) {
+ return dsl().dropTemporaryTableIfExists(table);
+ }
+
+ /**
+ * The DROP TEMPORARY TABLE IF EXISTS statement.
+ *
+ * @see DSLContext#dropTemporaryTableIfExists(Table)
+ */
+ @NotNull
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
+ public static org.jooq.DropTableStep dropTemporaryTableIfExists(Table> table) {
+ return dsl().dropTemporaryTableIfExists(table);
+ }
+
/**
* The DROP VIEW statement.
*
@@ -9148,147 +9280,6 @@ public class DSL {
return dsl().alterTableIfExists(table);
}
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSLContext#dropTable(String)
- */
- @NotNull
- @Support
- public static DropTableStep dropTable(String table) {
- return dsl().dropTable(table);
- }
-
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSLContext#dropTable(Name)
- */
- @NotNull
- @Support
- public static DropTableStep dropTable(Name table) {
- return dsl().dropTable(table);
- }
-
- /**
- * Create a new DSL DROP TABLE statement.
- *
- * @see DSLContext#dropTable(Table)
- */
- @NotNull
- @Support
- public static DropTableStep dropTable(Table> table) {
- return dsl().dropTable(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSLContext#dropTemporaryTable(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTable(String table) {
- return dsl().dropTemporaryTable(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSLContext#dropTemporaryTable(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTable(Name table) {
- return dsl().dropTemporaryTable(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE statement.
- *
- * @see DSLContext#dropTemporaryTable(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTable(Table> table) {
- return dsl().dropTemporaryTable(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSLContext#dropTemporaryTableIfExists(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTableIfExists(String table) {
- return dsl().dropTemporaryTableIfExists(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSLContext#dropTemporaryTableIfExists(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTableIfExists(Name table) {
- return dsl().dropTemporaryTableIfExists(table);
- }
-
- /**
- * Create a new DSL DROP TEMPORARY TABLE IF EXISTS statement.
- *
- * @see DSLContext#dropTemporaryTableIfExists(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
- public static DropTableStep dropTemporaryTableIfExists(Table> table) {
- return dsl().dropTemporaryTableIfExists(table);
- }
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSLContext#dropTableIfExists(String)
- */
- @NotNull
- @Support
- public static DropTableStep dropTableIfExists(String table) {
- return dsl().dropTableIfExists(table);
- }
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSLContext#dropTableIfExists(Name)
- */
- @NotNull
- @Support
- public static DropTableStep dropTableIfExists(Name table) {
- return dsl().dropTableIfExists(table);
- }
-
- /**
- * Create a new DSL DROP TABLE IF EXISTS statement.
- *
- * If your database doesn't natively support IF EXISTS, this is
- * emulated by catching (and ignoring) the relevant {@link SQLException}.
- *
- * @see DSLContext#dropTableIfExists(Table)
- */
- @NotNull
- @Support
- public static DropTableStep dropTableIfExists(Table> table) {
- return dsl().dropTableIfExists(table);
- }
-
/**
* Create a new DSL truncate statement.
*
diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
index a1e0b58d24..398aa9d91e 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
@@ -3146,6 +3146,66 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new DropSequenceImpl(configuration(), sequence, true);
}
+ @Override
+ public org.jooq.DropTableStep dropTable(String table) {
+ return new DropTableImpl(configuration(), false, DSL.table(DSL.name(table)), false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTable(Name table) {
+ return new DropTableImpl(configuration(), false, DSL.table(table), false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTable(Table> table) {
+ return new DropTableImpl(configuration(), false, table, false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTableIfExists(String table) {
+ return new DropTableImpl(configuration(), false, DSL.table(DSL.name(table)), true);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTableIfExists(Name table) {
+ return new DropTableImpl(configuration(), false, DSL.table(table), true);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTableIfExists(Table> table) {
+ return new DropTableImpl(configuration(), false, table, true);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTable(String table) {
+ return new DropTableImpl(configuration(), true, DSL.table(DSL.name(table)), false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTable(Name table) {
+ return new DropTableImpl(configuration(), true, DSL.table(table), false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTable(Table> table) {
+ return new DropTableImpl(configuration(), true, table, false);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTableIfExists(String table) {
+ return new DropTableImpl(configuration(), true, DSL.table(DSL.name(table)), true);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTableIfExists(Name table) {
+ return new DropTableImpl(configuration(), true, DSL.table(table), true);
+ }
+
+ @Override
+ public org.jooq.DropTableStep dropTemporaryTableIfExists(Table> table) {
+ return new DropTableImpl(configuration(), true, table, true);
+ }
+
@Override
public org.jooq.DropViewFinalStep dropView(String view) {
return new DropViewImpl(configuration(), DSL.table(DSL.name(view)), false);
@@ -3747,66 +3807,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new AlterTableImpl(configuration(), table, true);
}
- @Override
- public DropTableStep dropTable(String table) {
- return dropTable(name(table));
- }
-
- @Override
- public DropTableStep dropTable(Name table) {
- return dropTable(table(table));
- }
-
- @Override
- public DropTableStep dropTable(Table> table) {
- return new DropTableImpl(configuration(), table);
- }
-
- @Override
- public DropTableStep dropTemporaryTable(String table) {
- return dropTemporaryTable(name(table));
- }
-
- @Override
- public DropTableStep dropTemporaryTable(Name table) {
- return dropTemporaryTable(table(table));
- }
-
- @Override
- public DropTableStep dropTemporaryTable(Table> table) {
- return new DropTableImpl(configuration(), table, false, true);
- }
-
- @Override
- public DropTableStep dropTemporaryTableIfExists(String table) {
- return dropTemporaryTableIfExists(name(table));
- }
-
- @Override
- public DropTableStep dropTemporaryTableIfExists(Name table) {
- return dropTemporaryTableIfExists(table(table));
- }
-
- @Override
- public DropTableStep dropTemporaryTableIfExists(Table> table) {
- return new DropTableImpl(configuration(), table, true, true);
- }
-
- @Override
- public DropTableStep dropTableIfExists(String table) {
- return dropTableIfExists(name(table));
- }
-
- @Override
- public DropTableStep dropTableIfExists(Name table) {
- return dropTableIfExists(table(table));
- }
-
- @Override
- public DropTableStep dropTableIfExists(Table> table) {
- return new DropTableImpl(configuration(), table, true);
- }
-
@Override
public final TruncateIdentityStepDROP TABLE statement.
*/
-final class DropTableImpl extends AbstractRowCountQuery implements
+@SuppressWarnings({ "rawtypes", "unused" })
+final class DropTableImpl
+extends
+ AbstractRowCountQuery
+implements
+ DropTableStep,
+ DropTableFinalStep
+{
- // Cascading interface implementations for DROP TABLE behaviour
- DropTableStep {
+ private static final long serialVersionUID = 1L;
- /**
- * Generated UID
- */
- private static final long serialVersionUID = 8904572826501186329L;
- private static final Clause[] CLAUSES = { DROP_TABLE };
- private static final Set