diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java index 91f181d5bd..a9f1ca4a8d 100644 --- a/jOOQ/src/main/java/org/jooq/conf/Settings.java +++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java @@ -447,6 +447,10 @@ public class Settings protected NestedCollectionEmulation emulateMultiset = NestedCollectionEmulation.DEFAULT; @XmlElement(defaultValue = "false") protected Boolean emulateComputedColumns = false; + @XmlElement(defaultValue = "true") + protected Boolean computedOnClientVirtual = true; + @XmlElement(defaultValue = "true") + protected Boolean computedOnClientStored = true; @XmlElement(defaultValue = "LOG_DEBUG") @XmlSchemaType(name = "string") protected ExecuteWithoutWhere executeUpdateWithoutWhere = ExecuteWithoutWhere.LOG_DEBUG; @@ -5887,6 +5891,54 @@ public class Settings this.emulateComputedColumns = value; } + /** + * Whether VIRTUAL client side computed columns should be applied to queries. This feature is available only in commercial distributions. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isComputedOnClientVirtual() { + return computedOnClientVirtual; + } + + /** + * Whether VIRTUAL client side computed columns should be applied to queries. This feature is available only in commercial distributions. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setComputedOnClientVirtual(Boolean value) { + this.computedOnClientVirtual = value; + } + + /** + * Whether STORED client side computed columns should be applied to queries (including audit columns). This feature is available only in commercial distributions. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isComputedOnClientStored() { + return computedOnClientStored; + } + + /** + * Whether STORED client side computed columns should be applied to queries (including audit columns). This feature is available only in commercial distributions. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setComputedOnClientStored(Boolean value) { + this.computedOnClientStored = value; + } + /** * [#6771] Specifies whether UPDATE statements are allowed to be executed lacking a WHERE clause. This has no effect on rendering the statements SQL string. * @@ -9122,6 +9174,24 @@ public class Settings return this; } + /** + * Whether VIRTUAL client side computed columns should be applied to queries. This feature is available only in commercial distributions. + * + */ + public Settings withComputedOnClientVirtual(Boolean value) { + setComputedOnClientVirtual(value); + return this; + } + + /** + * Whether STORED client side computed columns should be applied to queries (including audit columns). This feature is available only in commercial distributions. + * + */ + public Settings withComputedOnClientStored(Boolean value) { + setComputedOnClientStored(value); + return this; + } + /** * [#6771] Specifies whether UPDATE statements are allowed to be executed lacking a WHERE clause. This has no effect on rendering the statements SQL string. * @@ -9770,6 +9840,8 @@ public class Settings builder.append("emulateOnDuplicateKeyUpdateOnPrimaryKeyOnly", emulateOnDuplicateKeyUpdateOnPrimaryKeyOnly); builder.append("emulateMultiset", emulateMultiset); builder.append("emulateComputedColumns", emulateComputedColumns); + builder.append("computedOnClientVirtual", computedOnClientVirtual); + builder.append("computedOnClientStored", computedOnClientStored); builder.append("executeUpdateWithoutWhere", executeUpdateWithoutWhere); builder.append("executeDeleteWithoutWhere", executeDeleteWithoutWhere); builder.append("interpreterDialect", interpreterDialect); @@ -11492,6 +11564,24 @@ public class Settings return false; } } + if (computedOnClientVirtual == null) { + if (other.computedOnClientVirtual!= null) { + return false; + } + } else { + if (!computedOnClientVirtual.equals(other.computedOnClientVirtual)) { + return false; + } + } + if (computedOnClientStored == null) { + if (other.computedOnClientStored!= null) { + return false; + } + } else { + if (!computedOnClientStored.equals(other.computedOnClientStored)) { + return false; + } + } if (executeUpdateWithoutWhere == null) { if (other.executeUpdateWithoutWhere!= null) { return false; @@ -12088,6 +12178,8 @@ public class Settings result = ((prime*result)+((emulateOnDuplicateKeyUpdateOnPrimaryKeyOnly == null)? 0 :emulateOnDuplicateKeyUpdateOnPrimaryKeyOnly.hashCode())); result = ((prime*result)+((emulateMultiset == null)? 0 :emulateMultiset.hashCode())); result = ((prime*result)+((emulateComputedColumns == null)? 0 :emulateComputedColumns.hashCode())); + result = ((prime*result)+((computedOnClientVirtual == null)? 0 :computedOnClientVirtual.hashCode())); + result = ((prime*result)+((computedOnClientStored == null)? 0 :computedOnClientStored.hashCode())); result = ((prime*result)+((executeUpdateWithoutWhere == null)? 0 :executeUpdateWithoutWhere.hashCode())); result = ((prime*result)+((executeDeleteWithoutWhere == null)? 0 :executeDeleteWithoutWhere.hashCode())); result = ((prime*result)+((interpreterDialect == null)? 0 :interpreterDialect.hashCode())); diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractDataType.java b/jOOQ/src/main/java/org/jooq/impl/AbstractDataType.java index e4169fb6fb..611a468cd2 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractDataType.java @@ -37,6 +37,7 @@ */ package org.jooq.impl; +import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; // ... // ... @@ -245,7 +246,8 @@ implements return computedOnClient(configuration) && generationOption(configuration) != GenerationOption.VIRTUAL && (generatedAlwaysAsGenerator().supports(GeneratorStatementType.INSERT) || - generatedAlwaysAsGenerator().supports(GeneratorStatementType.UPDATE)); + generatedAlwaysAsGenerator().supports(GeneratorStatementType.UPDATE)) + && !FALSE.equals(configuration.settings().isComputedOnClientStored()); } @Override @@ -257,7 +259,8 @@ implements public final boolean computedOnClientStoredOn(GeneratorStatementType statementType, Configuration configuration) { return computedOnClient(configuration) && generationOption(configuration) != GenerationOption.VIRTUAL - && generatedAlwaysAsGenerator().supports(statementType); + && generatedAlwaysAsGenerator().supports(statementType) + && !FALSE.equals(configuration.settings().isComputedOnClientStored()); } @Override @@ -269,7 +272,8 @@ implements public final boolean computedOnClientVirtual(Configuration configuration) { return computedOnClient(configuration) && generationOption(configuration) == GenerationOption.VIRTUAL - && generatedAlwaysAsGenerator().supports(GeneratorStatementType.SELECT); + && generatedAlwaysAsGenerator().supports(GeneratorStatementType.SELECT) + && !FALSE.equals(configuration.settings().isComputedOnClientVirtual()); } @Override diff --git a/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.20.0.xsd b/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.20.0.xsd index b867468c38..372e67d05b 100644 --- a/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.20.0.xsd +++ b/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.20.0.xsd @@ -1475,6 +1475,14 @@ This can be useful if a schema was generated using a dialect that supports compu deployed on an RDBMS that does not.]]> + + VIRTUAL client side computed columns should be applied to queries. This feature is available only in commercial distributions.]]> + + + + STORED client side computed columns should be applied to queries (including audit columns). This feature is available only in commercial distributions.]]> + +