From 599302b98029204ebeeec232558c6696c01ab5b5 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 15 Jan 2021 14:12:33 +0100 Subject: [PATCH 1/3] [jOOQ/jOOQ#9854] Fixed DECIMAL implementation for Firebird --- jOOQ/src/main/java/org/jooq/impl/Digits.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Digits.java b/jOOQ/src/main/java/org/jooq/impl/Digits.java index a26e5e259d..862e9ba640 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Digits.java +++ b/jOOQ/src/main/java/org/jooq/impl/Digits.java @@ -100,7 +100,7 @@ extends else if (t.getType() == Long.class) ctx.visit(DSL.lpad(DSL.abs(value).cast(VARCHAR(DefaultDataType.LONG_PRECISION)), inline(DefaultDataType.LONG_PRECISION), inline("0"))); else if (t.scaleDefined()) - ctx.visit(DSL.lpad(DSL.abs(value.mul(inline(java.math.BigDecimal.TEN.pow(t.scale())))).cast(VARCHAR(t.precision())), inline(t.precision()), inline("0"))); + ctx.visit(DSL.lpad(DSL.abs(value.mul(inline(java.math.BigDecimal.TEN.pow(t.scale())))).cast(t.scale(0)).cast(VARCHAR(t.precision())), inline(t.precision()), inline("0"))); else ctx.visit(DSL.lpad(DSL.abs(value).cast(VARCHAR(t.precision())), inline(t.precision()), inline("0"))); } From 7916e2c24c956798a2472973b239e0e58b903baf Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 15 Jan 2021 17:31:42 +0100 Subject: [PATCH 2/3] [jOOQ/jOOQ#6956] Add support for CREATE, DROP TRIGGER - Added DSL (CREATE, DROP) - Added parser support (DROP) - Added simple integration tests --- .../org/jooq/CreateTriggerActionStep.java | 90 ++++ .../org/jooq/CreateTriggerEventOfStep.java | 97 ++++ .../org/jooq/CreateTriggerEventOnStep.java | 90 ++++ .../org/jooq/CreateTriggerEventOrStep.java | 90 ++++ .../java/org/jooq/CreateTriggerEventStep.java | 132 +++++ .../java/org/jooq/CreateTriggerFinalStep.java | 69 +++ .../java/org/jooq/CreateTriggerForStep.java | 76 +++ .../jooq/CreateTriggerReferencingStep.java | 97 ++++ .../java/org/jooq/CreateTriggerWhenStep.java | 137 +++++ jOOQ/src/main/java/org/jooq/DSLContext.java | 84 +++ .../java/org/jooq/DropTriggerFinalStep.java | 69 +++ .../java/org/jooq/impl/CreateTriggerImpl.java | 497 ++++++++++++++++++ jOOQ/src/main/java/org/jooq/impl/DSL.java | 100 ++++ .../java/org/jooq/impl/DefaultDSLContext.java | 52 ++ .../java/org/jooq/impl/DropTriggerImpl.java | 109 ++++ .../src/main/java/org/jooq/impl/Keywords.java | 10 +- .../main/java/org/jooq/impl/ParserImpl.java | 21 +- 17 files changed, 1815 insertions(+), 5 deletions(-) create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java create mode 100644 jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java create mode 100644 jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/CreateTriggerImpl.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/DropTriggerImpl.java diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java new file mode 100644 index 0000000000..3ff37bb100 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java @@ -0,0 +1,90 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerActionStep { + + /** + * Add the STATEMENT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerFinalStep statement(Statement... statement); + + /** + * Add the STATEMENT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerFinalStep statement(Collection statement); + + /** + * Add the STATEMENT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerFinalStep statement(Statement statement); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java new file mode 100644 index 0000000000..761eb0233c --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java @@ -0,0 +1,97 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerEventOfStep extends CreateTriggerEventOrStep { + + /** + * Add the OF clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep of(String... of); + + /** + * Add the OF clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep of(Name... of); + + /** + * Add the OF clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep of(Field... of); + + /** + * Add the OF clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep of(Collection> of); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java new file mode 100644 index 0000000000..0b519727e4 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java @@ -0,0 +1,90 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerEventOnStep { + + /** + * Add the ON clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep on(@Stringly.Name String on); + + /** + * Add the ON clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep on(Name on); + + /** + * Add the ON clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep on(Table on); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java new file mode 100644 index 0000000000..f6301c02e9 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java @@ -0,0 +1,90 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerEventOrStep extends CreateTriggerEventOnStep { + + /** + * Add the OR INSERT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep orInsert(); + + /** + * Add the OR UPDATE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOfStep orUpdate(); + + /** + * Add the OR DELETE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep orDelete(); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java new file mode 100644 index 0000000000..84ac21778b --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java @@ -0,0 +1,132 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerEventStep { + + /** + * Add the BEFORE INSERT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep beforeInsert(); + + /** + * Add the AFTER INSERT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep afterInsert(); + + /** + * Add the INSTEAD OF INSERT clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep insteadOfInsert(); + + /** + * Add the BEFORE UPDATE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOfStep beforeUpdate(); + + /** + * Add the AFTER UPDATE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOfStep afterUpdate(); + + /** + * Add the INSTEAD OF UPDATE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOfStep insteadOfUpdate(); + + /** + * Add the BEFORE DELETE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep beforeDelete(); + + /** + * Add the AFTER DELETE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep afterDelete(); + + /** + * Add the INSTEAD OF DELETE clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerEventOrStep insteadOfDelete(); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java new file mode 100644 index 0000000000..092178d39f --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java @@ -0,0 +1,69 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerFinalStep extends DDLQuery { +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java new file mode 100644 index 0000000000..f1b5b15707 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java @@ -0,0 +1,76 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerForStep extends CreateTriggerWhenStep { + + /** + * Add the FOR EACH ROW clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerWhenStep forEachRow(); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java new file mode 100644 index 0000000000..51a78b4e3c --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java @@ -0,0 +1,97 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerReferencingStep extends CreateTriggerForStep { + + /** + * Add the REFERENCING OLD AS clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep referencingOldAs(@Stringly.Name String referencingOldAs); + + /** + * Add the REFERENCING OLD AS clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep referencingOldAs(Name referencingOldAs); + + /** + * Add the REFERENCING NEW AS clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep referencingNewAs(@Stringly.Name String referencingNewAs); + + /** + * Add the REFERENCING NEW AS clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerReferencingStep referencingNewAs(Name referencingNewAs); +} diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java new file mode 100644 index 0000000000..fd9372fdce --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java @@ -0,0 +1,137 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the CREATE TRIGGER statement. + *

+ *

Referencing 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: + *

+ */ +@SuppressWarnings({ "unused" }) +public interface CreateTriggerWhenStep extends CreateTriggerActionStep { + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerActionStep when(Field when); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerActionStep when(Condition... when); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerActionStep when(Collection when); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + */ + @Support + @NotNull + CreateTriggerActionStep when(Condition when); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + * + * @see SQL + */ + @Support + @PlainSQL + @NotNull + CreateTriggerActionStep when(@Stringly.SQL String when, QueryPart... parts); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + * + * @see SQL + */ + @Support + @PlainSQL + @NotNull + CreateTriggerActionStep when(@Stringly.SQL String when, Object... bindings); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + * + * @see SQL + */ + @Support + @PlainSQL + @NotNull + CreateTriggerActionStep when(@Stringly.SQL String when); + + /** + * Add the WHEN clause to the CREATE TRIGGER statement. + * + * @see SQL + */ + @Support + @PlainSQL + @NotNull + CreateTriggerActionStep when(SQL when); +} diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java index d7b0bff673..a3bf9b0755 100644 --- a/jOOQ/src/main/java/org/jooq/DSLContext.java +++ b/jOOQ/src/main/java/org/jooq/DSLContext.java @@ -9787,6 +9787,48 @@ public interface DSLContext extends Scope { @Support({ FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) CreateIndexStep createUniqueIndexIfNotExists(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * The CREATE SCHEMA statement. * @@ -10273,6 +10315,48 @@ public interface DSLContext extends Scope { @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES }) DropTableStep dropTemporaryTableIfExists(Table table); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * The DROP VIEW statement. * diff --git a/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java b/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java new file mode 100644 index 0000000000..38750b9ecd --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java @@ -0,0 +1,69 @@ +/* + * 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.*; + +import java.util.*; + +import org.jetbrains.annotations.*; + +/** + * A step in the construction of the DROP TRIGGER statement. + *

+ *

Referencing 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: + *

    + *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • + *
  • They're less composable and not easy to get right when dynamic SQL gets + * complex
  • + *
  • They're less readable
  • + *
  • They might have binary incompatible changes between minor releases
  • + *
+ */ +@SuppressWarnings({ "unused" }) +public interface DropTriggerFinalStep extends DDLQuery { +} diff --git a/jOOQ/src/main/java/org/jooq/impl/CreateTriggerImpl.java b/jOOQ/src/main/java/org/jooq/impl/CreateTriggerImpl.java new file mode 100644 index 0000000000..e00a32377b --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/CreateTriggerImpl.java @@ -0,0 +1,497 @@ +/* + * 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; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 3f1da17a50..603e41ad31 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -7788,6 +7788,56 @@ public class DSL { return dsl().createUniqueIndexIfNotExists(); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * The CREATE SCHEMA statement. * @@ -8382,6 +8432,56 @@ public class DSL { return dsl().dropTemporaryTableIfExists(table); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * The DROP VIEW statement. * diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java index fbcc32c9ee..88b4fdf68e 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java @@ -3056,6 +3056,32 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri return new CreateIndexImpl(configuration(), true, true); } + + + + + + + + + + + + + + + + + + + + + + + + + + @Override public org.jooq.CreateSchemaFinalStep createSchema(@Stringly.Name String schema) { return new CreateSchemaImpl(configuration(), DSL.schema(DSL.name(schema)), false); @@ -3326,6 +3352,32 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri return new DropTableImpl(configuration(), true, table, true); } + + + + + + + + + + + + + + + + + + + + + + + + + + @Override public org.jooq.DropViewFinalStep dropView(@Stringly.Name String view) { return new DropViewImpl(configuration(), DSL.table(DSL.name(view)), false); diff --git a/jOOQ/src/main/java/org/jooq/impl/DropTriggerImpl.java b/jOOQ/src/main/java/org/jooq/impl/DropTriggerImpl.java new file mode 100644 index 0000000000..7b0dded612 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/DropTriggerImpl.java @@ -0,0 +1,109 @@ +/* + * 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; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/Keywords.java b/jOOQ/src/main/java/org/jooq/impl/Keywords.java index e93f714743..88f4f0b85f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Keywords.java +++ b/jOOQ/src/main/java/org/jooq/impl/Keywords.java @@ -142,6 +142,7 @@ final class Keywords { static final Keyword K_DROP_SCHEMA = keyword("drop schema"); static final Keyword K_DROP_TABLE = keyword("drop table"); static final Keyword K_DROP_VIEW = keyword("drop view"); + static final Keyword K_EACH = keyword("each"); static final Keyword K_ELEMENTS = keyword("elements"); static final Keyword K_ELSE = keyword("else"); static final Keyword K_ELSEIF = keyword("elseif"); @@ -171,7 +172,7 @@ final class Keywords { static final Keyword K_FETCH_FIRST = keyword("fetch first"); static final Keyword K_FETCH_NEXT = keyword("fetch next"); static final Keyword K_FILTER = keyword("filter"); - static final Keyword K_FINAL_TABLE = keyword("final table"); + static final Keyword K_FINAL = keyword("final"); static final Keyword K_FIRST = keyword("first"); static final Keyword K_FOLLOWING = keyword("following"); static final Keyword K_FOR = keyword("for"); @@ -208,6 +209,7 @@ final class Keywords { static final Keyword K_INLINE = keyword("inline"); static final Keyword K_INNER_JOIN = keyword("inner join"); static final Keyword K_INSERT = keyword("insert"); + static final Keyword K_INSTEAD = keyword("instead"); static final Keyword K_INT = keyword("int"); static final Keyword K_INTERVAL = keyword("interval"); static final Keyword K_INTO = keyword("into"); @@ -252,7 +254,7 @@ final class Keywords { static final Keyword K_MONTH = keyword("month"); static final Keyword K_MULTISET = keyword("multiset"); static final Keyword K_NAME = keyword("name"); - static final Keyword K_NEW_TABLE = keyword("new table"); + static final Keyword K_NEW = keyword("new"); static final Keyword K_NEXTVAL = keyword("nextval"); static final Keyword K_NEXT_VALUE_FOR = keyword("next value for"); static final Keyword K_NO = keyword("no"); @@ -271,7 +273,7 @@ final class Keywords { static final Keyword K_NVARCHAR = keyword("nvarchar"); static final Keyword K_OF = keyword("of"); static final Keyword K_OFFSET = keyword("offset"); - static final Keyword K_OLD_TABLE = keyword("old table"); + static final Keyword K_OLD = keyword("old"); static final Keyword K_ON = keyword("on"); static final Keyword K_ON_COMMIT_DELETE_ROWS = keyword("on commit delete rows"); static final Keyword K_ON_COMMIT_DROP = keyword("on commit drop"); @@ -312,6 +314,7 @@ final class Keywords { static final Keyword K_RECURSIVE = keyword("recursive"); static final Keyword K_REF = keyword("ref"); static final Keyword K_REFERENCES = keyword("references"); + static final Keyword K_REFERENCING = keyword("referencing"); static final Keyword K_REGEXP = keyword("regexp"); static final Keyword K_RENAME = keyword("rename"); static final Keyword K_RENAME_COLUMN = keyword("rename column"); @@ -376,6 +379,7 @@ final class Keywords { static final Keyword K_TOP = keyword("top"); static final Keyword K_TRAILING = keyword("trailing"); static final Keyword K_TRIM = keyword("trim"); + static final Keyword K_TRIGGER = keyword("trigger"); static final Keyword K_TRUE = keyword("true"); static final Keyword K_TRUNCATE_TABLE = keyword("truncate table"); static final Keyword K_TYPE = keyword("type"); diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 4d63322fe9..9016f38887 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -2721,12 +2721,15 @@ final class ParserContext { return parseDropTable(false); else if (parseKeywordIf("TEMPORARY TABLE")) return parseDropTable(true); + else if (parseKeywordIf("TRIGGER") && requireProEdition()) + + + + ; else if (parseKeywordIf("TYPE")) return parseDropType(); else if (parseKeywordIf("TABLESPACE")) throw notImplemented("DROP TABLESPACE"); - else if (parseKeywordIf("TRIGGER")) - throw notImplemented("DROP TRIGGER", "https://github.com/jOOQ/jOOQ/issues/6956"); break; @@ -4891,6 +4894,20 @@ final class ParserContext { return s2; } + + + + + + + + + + + + + + private final DDLQuery parseDropType() { boolean ifExists = parseKeywordIf("IF EXISTS"); List typeNames = parseIdentifiers(); From e3bd8d2faab14c4f27ef123f070e5237acda0690 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 15 Jan 2021 17:39:56 +0100 Subject: [PATCH 3/3] [jOOQ/jOOQ#6956] Add support for CREATE, DROP TRIGGER - Added DSL (CREATE, DROP) - Added parser support (DROP) - Added simple integration tests --- .../org/jooq/CreateTriggerActionStep.java | 94 ++++----- .../org/jooq/CreateTriggerEventOfStep.java | 106 ++++++----- .../org/jooq/CreateTriggerEventOnStep.java | 94 ++++----- .../org/jooq/CreateTriggerEventOrStep.java | 94 ++++----- .../java/org/jooq/CreateTriggerEventStep.java | 166 ++++++++-------- .../java/org/jooq/CreateTriggerFinalStep.java | 58 +++--- .../java/org/jooq/CreateTriggerForStep.java | 70 +++---- .../jooq/CreateTriggerReferencingStep.java | 106 ++++++----- .../java/org/jooq/CreateTriggerWhenStep.java | 178 +++++++++--------- .../java/org/jooq/DropTriggerFinalStep.java | 58 +++--- 10 files changed, 532 insertions(+), 492 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java index 3ff37bb100..8cf25d7367 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerActionStep.java @@ -37,54 +37,58 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerActionStep { - /** - * Add the STATEMENT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerFinalStep statement(Statement... statement); - /** - * Add the STATEMENT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerFinalStep statement(Collection statement); - /** - * Add the STATEMENT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerFinalStep statement(Statement statement); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java index 761eb0233c..921bb6b887 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOfStep.java @@ -37,61 +37,65 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerEventOfStep extends CreateTriggerEventOrStep { - /** - * Add the OF clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep of(String... of); - /** - * Add the OF clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep of(Name... of); - /** - * Add the OF clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep of(Field... of); - /** - * Add the OF clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep of(Collection> of); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java index 0b519727e4..8cf25d7367 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOnStep.java @@ -37,54 +37,58 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerEventOnStep { - /** - * Add the ON clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep on(@Stringly.Name String on); - /** - * Add the ON clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep on(Name on); - /** - * Add the ON clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep on(Table on); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java index f6301c02e9..8cf25d7367 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventOrStep.java @@ -37,54 +37,58 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerEventOrStep extends CreateTriggerEventOnStep { - /** - * Add the OR INSERT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep orInsert(); - /** - * Add the OR UPDATE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOfStep orUpdate(); - /** - * Add the OR DELETE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep orDelete(); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java index 84ac21778b..4e748fe93b 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerEventStep.java @@ -37,96 +37,100 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerEventStep { - /** - * Add the BEFORE INSERT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep beforeInsert(); - /** - * Add the AFTER INSERT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep afterInsert(); - /** - * Add the INSTEAD OF INSERT clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep insteadOfInsert(); - /** - * Add the BEFORE UPDATE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOfStep beforeUpdate(); - /** - * Add the AFTER UPDATE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOfStep afterUpdate(); - /** - * Add the INSTEAD OF UPDATE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOfStep insteadOfUpdate(); - /** - * Add the BEFORE DELETE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep beforeDelete(); - /** - * Add the AFTER DELETE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep afterDelete(); - /** - * Add the INSTEAD OF DELETE clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerEventOrStep insteadOfDelete(); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java index 092178d39f..8017dfe66e 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerFinalStep.java @@ -37,33 +37,37 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerFinalStep extends DDLQuery { -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java index f1b5b15707..6312365c62 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerForStep.java @@ -37,40 +37,44 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerForStep extends CreateTriggerWhenStep { - /** - * Add the FOR EACH ROW clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerWhenStep forEachRow(); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java index 51a78b4e3c..921bb6b887 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerReferencingStep.java @@ -37,61 +37,65 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerReferencingStep extends CreateTriggerForStep { - /** - * Add the REFERENCING OLD AS clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep referencingOldAs(@Stringly.Name String referencingOldAs); - /** - * Add the REFERENCING OLD AS clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep referencingOldAs(Name referencingOldAs); - /** - * Add the REFERENCING NEW AS clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep referencingNewAs(@Stringly.Name String referencingNewAs); - /** - * Add the REFERENCING NEW AS clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerReferencingStep referencingNewAs(Name referencingNewAs); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java b/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java index fd9372fdce..9183e4630a 100644 --- a/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateTriggerWhenStep.java @@ -37,101 +37,105 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the CREATE TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface CreateTriggerWhenStep extends CreateTriggerActionStep { - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerActionStep when(Field when); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerActionStep when(Condition... when); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerActionStep when(Collection when); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - */ - @Support - @NotNull - CreateTriggerActionStep when(Condition when); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - * - * @see SQL - */ - @Support - @PlainSQL - @NotNull - CreateTriggerActionStep when(@Stringly.SQL String when, QueryPart... parts); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - * - * @see SQL - */ - @Support - @PlainSQL - @NotNull - CreateTriggerActionStep when(@Stringly.SQL String when, Object... bindings); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - * - * @see SQL - */ - @Support - @PlainSQL - @NotNull - CreateTriggerActionStep when(@Stringly.SQL String when); - /** - * Add the WHEN clause to the CREATE TRIGGER statement. - * - * @see SQL - */ - @Support - @PlainSQL - @NotNull - CreateTriggerActionStep when(SQL when); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java b/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java index 38750b9ecd..8017dfe66e 100644 --- a/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java +++ b/jOOQ/src/main/java/org/jooq/DropTriggerFinalStep.java @@ -37,33 +37,37 @@ */ package org.jooq; -import static org.jooq.SQLDialect.*; -import java.util.*; -import org.jetbrains.annotations.*; -/** - * A step in the construction of the DROP TRIGGER statement. - *

- *

Referencing 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: - *

    - *
  • They're operating on mutable implementations (as of jOOQ 3.x)
  • - *
  • They're less composable and not easy to get right when dynamic SQL gets - * complex
  • - *
  • They're less readable
  • - *
  • They might have binary incompatible changes between minor releases
  • - *
- */ -@SuppressWarnings({ "unused" }) -public interface DropTriggerFinalStep extends DDLQuery { -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +