diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java
index ce3ab1288e..9c599d19c1 100644
--- a/jOOQ/src/main/java/org/jooq/conf/Settings.java
+++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java
@@ -189,6 +189,8 @@ public class Settings
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsCaseToCaseAbbreviation = true;
@XmlElement(defaultValue = "true")
+ protected Boolean transformPatternsSimplifyCaseAbbreviation = true;
+ @XmlElement(defaultValue = "true")
protected Boolean transformPatternsTrivialCaseAbbreviation = true;
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsTrivialPredicates = true;
@@ -2323,6 +2325,38 @@ public class Settings
this.transformPatternsCaseToCaseAbbreviation = value;
}
+ /**
+ * Transform complex predicates into simpler CASE abbreviations.
+ *
+ * Some predicates can be simplified into case abbreviations, such as, for example + *
a IS NULL OR COALESCE(a = b, FALSE) to NULLIF(a, b) IS NULLa IS NOT NULL AND COALESCE(a != b, TRUE) to NULLIF(a, b) IS NOT NULL
+ * This feature is available in the commercial distribution only.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isTransformPatternsSimplifyCaseAbbreviation() {
+ return transformPatternsSimplifyCaseAbbreviation;
+ }
+
+ /**
+ * Sets the value of the transformPatternsSimplifyCaseAbbreviation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setTransformPatternsSimplifyCaseAbbreviation(Boolean value) {
+ this.transformPatternsSimplifyCaseAbbreviation = value;
+ }
+
/**
* Transform trivial case abbreviations like NVL(NULL, a) to a.
*
@@ -5375,6 +5409,11 @@ public class Settings return this; } + public Settings withTransformPatternsSimplifyCaseAbbreviation(Boolean value) { + setTransformPatternsSimplifyCaseAbbreviation(value); + return this; + } + public Settings withTransformPatternsTrivialCaseAbbreviation(Boolean value) { setTransformPatternsTrivialCaseAbbreviation(value); return this; @@ -6360,6 +6399,7 @@ public class Settings builder.append("transformPatternsCaseMergeWhenElse", transformPatternsCaseMergeWhenElse); builder.append("transformPatternsCaseThenBoolean", transformPatternsCaseThenBoolean); builder.append("transformPatternsCaseToCaseAbbreviation", transformPatternsCaseToCaseAbbreviation); + builder.append("transformPatternsSimplifyCaseAbbreviation", transformPatternsSimplifyCaseAbbreviation); builder.append("transformPatternsTrivialCaseAbbreviation", transformPatternsTrivialCaseAbbreviation); builder.append("transformPatternsTrivialPredicates", transformPatternsTrivialPredicates); builder.append("transformPatternsScalarSubqueryCountAsteriskGtZero", transformPatternsScalarSubqueryCountAsteriskGtZero); @@ -7118,6 +7158,15 @@ public class Settings return false; } } + if (transformPatternsSimplifyCaseAbbreviation == null) { + if (other.transformPatternsSimplifyCaseAbbreviation!= null) { + return false; + } + } else { + if (!transformPatternsSimplifyCaseAbbreviation.equals(other.transformPatternsSimplifyCaseAbbreviation)) { + return false; + } + } if (transformPatternsTrivialCaseAbbreviation == null) { if (other.transformPatternsTrivialCaseAbbreviation!= null) { return false; @@ -8238,6 +8287,7 @@ public class Settings result = ((prime*result)+((transformPatternsCaseMergeWhenElse == null)? 0 :transformPatternsCaseMergeWhenElse.hashCode())); result = ((prime*result)+((transformPatternsCaseThenBoolean == null)? 0 :transformPatternsCaseThenBoolean.hashCode())); result = ((prime*result)+((transformPatternsCaseToCaseAbbreviation == null)? 0 :transformPatternsCaseToCaseAbbreviation.hashCode())); + result = ((prime*result)+((transformPatternsSimplifyCaseAbbreviation == null)? 0 :transformPatternsSimplifyCaseAbbreviation.hashCode())); result = ((prime*result)+((transformPatternsTrivialCaseAbbreviation == null)? 0 :transformPatternsTrivialCaseAbbreviation.hashCode())); result = ((prime*result)+((transformPatternsTrivialPredicates == null)? 0 :transformPatternsTrivialPredicates.hashCode())); result = ((prime*result)+((transformPatternsScalarSubqueryCountAsteriskGtZero == null)? 0 :transformPatternsScalarSubqueryCountAsteriskGtZero.hashCode())); diff --git a/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.18.0.xsd b/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.18.0.xsd index 7b29fd9c65..9b5811577b 100644 --- a/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.18.0.xsd +++ b/jOOQ/src/main/resources/org/jooq/xsd/jooq-runtime-3.18.0.xsd @@ -609,6 +609,18 @@ This feature is available in the commercial distribution only.]]><
Some CASE expressions have a shorter abbreviated form, such as COALESCE() or NULLIF().
+This feature is available in the commercial distribution only.]]>
+
+
+
+Some predicates can be simplified into case abbreviations, such as, for example
+
This feature is available in the commercial distribution only.]]>
+
+a IS NULL OR COALESCE(a = b, FALSE) to NULLIF(a, b) IS NULLa IS NOT NULL AND COALESCE(a != b, TRUE) to NULLIF(a, b) IS NOT NULL