[jOOQ/jOOQ#13593] Settings.transformPatternsNormaliseCoalesceToNvl

This commit is contained in:
Lukas Eder 2022-11-02 09:07:20 +01:00
parent 2954736bf3
commit 41106dccee
3 changed files with 62 additions and 0 deletions

View File

@ -163,6 +163,8 @@ public class Settings
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsNormaliseFieldCompareValue = true;
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsNormaliseCoalesceToNvl = true;
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsOrEqToIn = true;
@XmlElement(defaultValue = "true")
protected Boolean transformPatternsAndNeToNotIn = true;
@ -1945,6 +1947,34 @@ public class Settings
this.transformPatternsNormaliseFieldCompareValue = value;
}
/**
* Transform 2 argument <code>COALESCE(a, b)</code> to <code>NVL(a, b)</code>.
* <p>
* To enable this feature, {@link #transformPatterns} must be enabled as well.
* <p>
* This feature is available in the commercial distribution only.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isTransformPatternsNormaliseCoalesceToNvl() {
return transformPatternsNormaliseCoalesceToNvl;
}
/**
* Sets the value of the transformPatternsNormaliseCoalesceToNvl property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setTransformPatternsNormaliseCoalesceToNvl(Boolean value) {
this.transformPatternsNormaliseCoalesceToNvl = value;
}
/**
* Transform <code>x = c1 OR x = c2</code> to <code>x IN (c1, c2)</code>.
* <p>
@ -5344,6 +5374,11 @@ public class Settings
return this;
}
public Settings withTransformPatternsNormaliseCoalesceToNvl(Boolean value) {
setTransformPatternsNormaliseCoalesceToNvl(value);
return this;
}
public Settings withTransformPatternsOrEqToIn(Boolean value) {
setTransformPatternsOrEqToIn(value);
return this;
@ -6386,6 +6421,7 @@ public class Settings
builder.append("transformPatternsNormaliseAssociativeOps", transformPatternsNormaliseAssociativeOps);
builder.append("transformPatternsNormaliseInListSingleElementToComparison", transformPatternsNormaliseInListSingleElementToComparison);
builder.append("transformPatternsNormaliseFieldCompareValue", transformPatternsNormaliseFieldCompareValue);
builder.append("transformPatternsNormaliseCoalesceToNvl", transformPatternsNormaliseCoalesceToNvl);
builder.append("transformPatternsOrEqToIn", transformPatternsOrEqToIn);
builder.append("transformPatternsAndNeToNotIn", transformPatternsAndNeToNotIn);
builder.append("transformPatternsMergeOrComparison", transformPatternsMergeOrComparison);
@ -7041,6 +7077,15 @@ public class Settings
return false;
}
}
if (transformPatternsNormaliseCoalesceToNvl == null) {
if (other.transformPatternsNormaliseCoalesceToNvl!= null) {
return false;
}
} else {
if (!transformPatternsNormaliseCoalesceToNvl.equals(other.transformPatternsNormaliseCoalesceToNvl)) {
return false;
}
}
if (transformPatternsOrEqToIn == null) {
if (other.transformPatternsOrEqToIn!= null) {
return false;
@ -8274,6 +8319,7 @@ public class Settings
result = ((prime*result)+((transformPatternsNormaliseAssociativeOps == null)? 0 :transformPatternsNormaliseAssociativeOps.hashCode()));
result = ((prime*result)+((transformPatternsNormaliseInListSingleElementToComparison == null)? 0 :transformPatternsNormaliseInListSingleElementToComparison.hashCode()));
result = ((prime*result)+((transformPatternsNormaliseFieldCompareValue == null)? 0 :transformPatternsNormaliseFieldCompareValue.hashCode()));
result = ((prime*result)+((transformPatternsNormaliseCoalesceToNvl == null)? 0 :transformPatternsNormaliseCoalesceToNvl.hashCode()));
result = ((prime*result)+((transformPatternsOrEqToIn == null)? 0 :transformPatternsOrEqToIn.hashCode()));
result = ((prime*result)+((transformPatternsAndNeToNotIn == null)? 0 :transformPatternsAndNeToNotIn.hashCode()));
result = ((prime*result)+((transformPatternsMergeOrComparison == null)? 0 :transformPatternsMergeOrComparison.hashCode()));

View File

@ -1871,6 +1871,14 @@ package org.jooq.impl;

View File

@ -492,6 +492,14 @@ To enable this feature, {@link #transformPatterns} must be enabled as well.
This feature is available in the commercial distribution only.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="transformPatternsNormaliseCoalesceToNvl" type="boolean" minOccurs="0" maxOccurs="1" default="true">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Transform 2 argument <code>COALESCE(a, b)</code> to <code>NVL(a, b)</code>.
<p>
To enable this feature, {@link #transformPatterns} must be enabled as well.
<p>
This feature is available in the commercial distribution only.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="transformPatternsOrEqToIn" type="boolean" minOccurs="0" maxOccurs="1" default="true">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Transform <code>x = c1 OR x = c2</code> to <code>x IN (c1, c2)</code>.
<p>