diff --git a/jOOQ/src/main/java/org/jooq/DropTypeFinalStep.java b/jOOQ/src/main/java/org/jooq/DropTypeFinalStep.java new file mode 100644 index 0000000000..5de902bb30 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/DropTypeFinalStep.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** + * A {@link Query} that can drop types. + *
+ *
XYZ*Step types directly from client code
+ * It is usually not recommended to reference any XYZ*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.
+ *
+ * Drawbacks of referencing the XYZ*Step types directly:
+ *
+ *
XYZ*Step types directly from client code
+ * It is usually not recommended to reference any XYZ*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.
+ *
+ * Drawbacks of referencing the XYZ*Step types directly:
+ *
CASCADE clause to the DROP TYPE statement.
+ */
+ @Support({ H2, POSTGRES })
+ DropTypeFinalStep cascade();
+
+ /**
+ * Add the RESTRICT clause to the DROP TYPE statement.
+ */
+ @Support({ H2, POSTGRES })
+ DropTypeFinalStep restrict();
+}
diff --git a/jOOQ/src/main/java/org/jooq/impl/DropTypeImpl.java b/jOOQ/src/main/java/org/jooq/impl/DropTypeImpl.java
new file mode 100644
index 0000000000..472540ffa7
--- /dev/null
+++ b/jOOQ/src/main/java/org/jooq/impl/DropTypeImpl.java
@@ -0,0 +1,115 @@
+/*
+ * 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.impl;
+
+import static org.jooq.impl.Keywords.K_CASCADE;
+import static org.jooq.impl.Keywords.K_DROP;
+import static org.jooq.impl.Keywords.K_IF_EXISTS;
+import static org.jooq.impl.Keywords.K_RESTRICT;
+import static org.jooq.impl.Keywords.K_TYPE;
+
+import java.util.Collection;
+
+import org.jooq.Clause;
+import org.jooq.Configuration;
+import org.jooq.Context;
+import org.jooq.DropTypeFinalStep;
+import org.jooq.DropTypeStep;
+import org.jooq.Name;
+
+/**
+ * @author Lukas Eder
+ */
+final class DropTypeImpl extends AbstractQuery implements
+
+ // Cascading interface implementations for CREATE TYPE behaviour
+ DropTypeStep {
+
+ private static final long serialVersionUID = -5018375056147329888L;
+ private final QueryPartList