diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java
index 7df0963ab9..e3dd7c21c4 100644
--- a/jOOQ/src/main/java/org/jooq/DSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/DSLContext.java
@@ -9787,6 +9787,60 @@ public interface DSLContext extends Scope {
@Support({ FIREBIRD, H2, HSQLDB, POSTGRES })
DropDomainCascadeStep dropDomainIfExists(Domain> domain);
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSL#dropIndex(String)
+ */
+ @NotNull
+ @Support
+ DropIndexOnStep dropIndex(String index);
+
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSL#dropIndex(Name)
+ */
+ @NotNull
+ @Support
+ DropIndexOnStep dropIndex(Name index);
+
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSL#dropIndex(Index)
+ */
+ @NotNull
+ @Support
+ DropIndexOnStep dropIndex(Index index);
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSL#dropIndexIfExists(String)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ DropIndexOnStep dropIndexIfExists(String index);
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSL#dropIndexIfExists(Name)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ DropIndexOnStep dropIndexIfExists(Name index);
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSL#dropIndexIfExists(Index)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ DropIndexOnStep dropIndexIfExists(Index index);
+
/**
* The DROP SCHEMA statement.
*
@@ -11153,69 +11207,6 @@ public interface DSLContext extends Scope {
@Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES })
DropTableStep dropTemporaryTableIfExists(Table> table);
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSL#dropIndex(String)
- */
- @NotNull
- @Support
- DropIndexOnStep dropIndex(String index);
-
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSL#dropIndex(Name)
- */
- @NotNull
- @Support
- DropIndexOnStep dropIndex(Name index);
-
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSL#dropIndex(Name)
- */
- @NotNull
- @Support
- DropIndexOnStep dropIndex(Index index);
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(String)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- DropIndexOnStep dropIndexIfExists(String index);
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(Name)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- DropIndexOnStep dropIndexIfExists(Name index);
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(Name)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- DropIndexOnStep dropIndexIfExists(Index index);
-
/**
* Create a new DSL truncate statement.
*
diff --git a/jOOQ/src/main/java/org/jooq/DropIndexCascadeStep.java b/jOOQ/src/main/java/org/jooq/DropIndexCascadeStep.java
index 767f62c862..f77e0c8d18 100644
--- a/jOOQ/src/main/java/org/jooq/DropIndexCascadeStep.java
+++ b/jOOQ/src/main/java/org/jooq/DropIndexCascadeStep.java
@@ -37,15 +37,14 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
import org.jetbrains.annotations.*;
-
-// ...
-// ...
-import static org.jooq.SQLDialect.POSTGRES;
-
/**
- * A {@link Query} that can drop indexes.
+ * A step in the construction of the DROP INDEX statement.
*
*
XYZ*Step types directly from client code@@ -64,24 +63,21 @@ import static org.jooq.SQLDialect.POSTGRES; *
CASCADE clause to the DROP INDEX
- * statement.
+ * Add the CASCADE clause to the DROP INDEX statement.
*/
- @NotNull
@Support({ POSTGRES })
+ @NotNull
DropIndexFinalStep cascade();
/**
- * Add the RESTRICT clause to the DROP INDEX
- * statement.
+ * Add the RESTRICT clause to the DROP INDEX statement.
*/
- @NotNull
@Support({ POSTGRES })
+ @NotNull
DropIndexFinalStep restrict();
}
diff --git a/jOOQ/src/main/java/org/jooq/DropIndexFinalStep.java b/jOOQ/src/main/java/org/jooq/DropIndexFinalStep.java
index 798e640e3a..20cfe93fef 100644
--- a/jOOQ/src/main/java/org/jooq/DropIndexFinalStep.java
+++ b/jOOQ/src/main/java/org/jooq/DropIndexFinalStep.java
@@ -37,9 +37,14 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
+import org.jetbrains.annotations.*;
/**
- * A {@link Query} that can drop indexes.
+ * A step in the construction of the DROP INDEX statement.
* *
XYZ*Step types directly from client code@@ -58,9 +63,7 @@ package org.jooq; *
DROP INDEX statement.
* *
XYZ*Step types directly from client code@@ -85,50 +63,43 @@ import static org.jooq.SQLDialect.SQLITE; *
ON clause to the DROP INDEX statement.
*
- * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and
- * {@link SQLDialect#SQLSERVER} use table-scoped index names, not
- * schema-scoped names. This means that in these databases, the
- * ON clause is mandatory in order to unambiguously identify an
- * index. In all other databases, the ON clause will simply be
- * ignored for compatibility reasons.
+ * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and {@link SQLDialect#SQLSERVER}
+ * use table-scoped index names, not schema-scoped names. This means that in these databases,
+ * the ON clause is mandatory in order to unambiguously identify an index. In all other
+ * databases, the ON clause will simply be ignored for compatibility reasons.
*/
- @NotNull
@Support
- DropIndexCascadeStep on(Table> table);
+ @NotNull
+ DropIndexCascadeStep on(String on);
/**
- * Specify the table expression on which to drop an index.
+ * Add the ON clause to the DROP INDEX statement.
*
- * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and
- * {@link SQLDialect#SQLSERVER} use table-scoped index names, not
- * schema-scoped names. This means that in these databases, the
- * ON clause is mandatory in order to unambiguously identify an
- * index. In all other databases, the ON clause will simply be
- * ignored for compatibility reasons.
+ * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and {@link SQLDialect#SQLSERVER}
+ * use table-scoped index names, not schema-scoped names. This means that in these databases,
+ * the ON clause is mandatory in order to unambiguously identify an index. In all other
+ * databases, the ON clause will simply be ignored for compatibility reasons.
*/
- @NotNull
@Support
- DropIndexCascadeStep on(String tableName);
+ @NotNull
+ DropIndexCascadeStep on(Name on);
/**
- * Specify the table expression on which to drop an index.
+ * Add the ON clause to the DROP INDEX statement.
*
- * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and
- * {@link SQLDialect#SQLSERVER} use table-scoped index names, not
- * schema-scoped names. This means that in these databases, the
- * ON clause is mandatory in order to unambiguously identify an
- * index. In all other databases, the ON clause will simply be
- * ignored for compatibility reasons.
+ * {@link SQLDialect#MYSQL}, {@link SQLDialect#MARIADB}, and {@link SQLDialect#SQLSERVER}
+ * use table-scoped index names, not schema-scoped names. This means that in these databases,
+ * the ON clause is mandatory in order to unambiguously identify an index. In all other
+ * databases, the ON clause will simply be ignored for compatibility reasons.
*/
- @NotNull
@Support
- DropIndexCascadeStep on(Name tableName);
+ @NotNull
+ DropIndexCascadeStep on(Table> on);
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/AlterIndexImpl.java b/jOOQ/src/main/java/org/jooq/impl/AlterIndexImpl.java
index 43b309e374..ba05221f70 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AlterIndexImpl.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AlterIndexImpl.java
@@ -110,7 +110,7 @@ implements
// -------------------------------------------------------------------------
// XXX: DSL API
// -------------------------------------------------------------------------
-
+
@Override
public final AlterIndexImpl on(String on) {
return on(DSL.table(DSL.name(on)));
diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java
index 660f754242..29ba76745d 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DSL.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java
@@ -7799,6 +7799,72 @@ public class DSL {
return dsl().dropDomainIfExists(domain);
}
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSLContext#dropIndex(String)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropIndexOnStep dropIndex(String index) {
+ return dsl().dropIndex(index);
+ }
+
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSLContext#dropIndex(Name)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropIndexOnStep dropIndex(Name index) {
+ return dsl().dropIndex(index);
+ }
+
+ /**
+ * The DROP INDEX statement.
+ *
+ * @see DSLContext#dropIndex(Index)
+ */
+ @NotNull
+ @Support
+ public static org.jooq.DropIndexOnStep dropIndex(Index index) {
+ return dsl().dropIndex(index);
+ }
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSLContext#dropIndexIfExists(String)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ public static org.jooq.DropIndexOnStep dropIndexIfExists(String index) {
+ return dsl().dropIndexIfExists(index);
+ }
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSLContext#dropIndexIfExists(Name)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ public static org.jooq.DropIndexOnStep dropIndexIfExists(Name index) {
+ return dsl().dropIndexIfExists(index);
+ }
+
+ /**
+ * The DROP INDEX IF EXISTS statement.
+ *
+ * @see DSLContext#dropIndexIfExists(Index)
+ */
+ @NotNull
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
+ public static org.jooq.DropIndexOnStep dropIndexIfExists(Index index) {
+ return dsl().dropIndexIfExists(index);
+ }
+
/**
* The DROP SCHEMA statement.
*
@@ -9232,81 +9298,6 @@ public class DSL {
return dsl().dropTableIfExists(table);
}
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSLContext#dropIndex(String)
- */
- @NotNull
- @Support
- public static DropIndexOnStep dropIndex(String index) {
- return dsl().dropIndex(index);
- }
-
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSLContext#dropIndex(Name)
- */
- @NotNull
- @Support
- public static DropIndexOnStep dropIndex(Name index) {
- return dsl().dropIndex(index);
- }
-
- /**
- * Create a new DSL DROP INDEX statement.
- *
- * @see DSLContext#dropIndex(Index)
- */
- @NotNull
- @Support
- public static DropIndexOnStep dropIndex(Index index) {
- return dsl().dropIndex(index);
- }
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(String)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- public static DropIndexOnStep dropIndexIfExists(String index) {
- return dsl().dropIndexIfExists(index);
- }
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(Name)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- public static DropIndexOnStep dropIndexIfExists(Name index) {
- return dsl().dropIndexIfExists(index);
- }
-
- /**
- * Create a new DSL DROP INDEX 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#dropIndexIfExists(Index)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES, SQLITE })
- public static DropIndexOnStep dropIndexIfExists(Index index) {
- return dsl().dropIndexIfExists(index);
- }
-
/**
* 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 876fcb7ef0..f222c73178 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
@@ -3056,6 +3056,36 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new DropDomainImpl(configuration(), domain, true);
}
+ @Override
+ public org.jooq.DropIndexOnStep dropIndex(String index) {
+ return new DropIndexImpl(configuration(), DSL.index(DSL.name(index)), false);
+ }
+
+ @Override
+ public org.jooq.DropIndexOnStep dropIndex(Name index) {
+ return new DropIndexImpl(configuration(), DSL.index(index), false);
+ }
+
+ @Override
+ public org.jooq.DropIndexOnStep dropIndex(Index index) {
+ return new DropIndexImpl(configuration(), index, false);
+ }
+
+ @Override
+ public org.jooq.DropIndexOnStep dropIndexIfExists(String index) {
+ return new DropIndexImpl(configuration(), DSL.index(DSL.name(index)), true);
+ }
+
+ @Override
+ public org.jooq.DropIndexOnStep dropIndexIfExists(Name index) {
+ return new DropIndexImpl(configuration(), DSL.index(index), true);
+ }
+
+ @Override
+ public org.jooq.DropIndexOnStep dropIndexIfExists(Index index) {
+ return new DropIndexImpl(configuration(), index, true);
+ }
+
@Override
public org.jooq.DropSchemaStep dropSchema(String schema) {
return new DropSchemaImpl(configuration(), DSL.schema(DSL.name(schema)), false);
@@ -3777,36 +3807,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new DropTableImpl(configuration(), table, true);
}
- @Override
- public DropIndexOnStep dropIndex(String index) {
- return dropIndex(name(index));
- }
-
- @Override
- public DropIndexOnStep dropIndex(Name index) {
- return dropIndex(index(index));
- }
-
- @Override
- public DropIndexOnStep dropIndex(Index index) {
- return new DropIndexImpl(configuration(), index);
- }
-
- @Override
- public DropIndexOnStep dropIndexIfExists(String index) {
- return dropIndexIfExists(name(index));
- }
-
- @Override
- public DropIndexOnStep dropIndexIfExists(Name index) {
- return dropIndexIfExists(index(index));
- }
-
- @Override
- public DropIndexOnStep dropIndexIfExists(Index index) {
- return new DropIndexImpl(configuration(), index, true);
- }
-
@Override
public final TruncateIdentityStepDROP INDEX statement.
*/
-final class DropIndexImpl extends AbstractRowCountQuery implements
+@SuppressWarnings({ "hiding", "rawtypes", "unused" })
+final class DropIndexImpl
+extends
+ AbstractRowCountQuery
+implements
+ DropIndexOnStep,
+ DropIndexCascadeStep,
+ DropIndexFinalStep
+{
- // Cascading interface implementations for DROP INDEX behaviour
- DropIndexOnStep {
+ private static final long serialVersionUID = 1L;
- /**
- * Generated UID
- */
- private static final long serialVersionUID = 8904572826501186329L;
- private static final Clause[] CLAUSES = { DROP_INDEX };
- private static final Set