diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java index 4eed197f70..09419241fa 100644 --- a/jOOQ/src/main/java/org/jooq/conf/Settings.java +++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java @@ -70,6 +70,8 @@ public class Settings @XmlElement(defaultValue = "false") protected Boolean renderFormatted = false; protected RenderFormatting renderFormatting; + @XmlElement(defaultValue = "false") + protected Boolean renderNullifEmptyStringForBindValues = false; @XmlElement(defaultValue = "NEVER") @XmlSchemaType(name = "string") protected AutoAliasExpressions renderAutoAliasedDerivedTableExpressions = AutoAliasExpressions.NEVER; @@ -897,6 +899,34 @@ public class Settings this.renderFormatting = value; } + /** + * Whether to wrap String typed bind values with NULLIF(?, '') for Oracle compatibility. + *
+ * This feature is available in the commercial distribution only. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isRenderNullifEmptyStringForBindValues() { + return renderNullifEmptyStringForBindValues; + } + + /** + * Whether to wrap String typed bind values with NULLIF(?, '') for Oracle compatibility. + *
+ * This feature is available in the commercial distribution only. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setRenderNullifEmptyStringForBindValues(Boolean value) { + this.renderNullifEmptyStringForBindValues = value; + } + /** * Whether to auto-alias expressions in derived tables. *
@@ -6840,6 +6870,17 @@ public class Settings return this; } + /** + * Whether to wrap String typed bind values with NULLIF(?, '') for Oracle compatibility. + *
+ * This feature is available in the commercial distribution only. + * + */ + public Settings withRenderNullifEmptyStringForBindValues(Boolean value) { + setRenderNullifEmptyStringForBindValues(value); + return this; + } + /** * Whether to auto-alias expressions in derived tables. *
@@ -9455,6 +9496,7 @@ public class Settings
builder.append("renderLocale", renderLocale);
builder.append("renderFormatted", renderFormatted);
builder.append("renderFormatting", renderFormatting);
+ builder.append("renderNullifEmptyStringForBindValues", renderNullifEmptyStringForBindValues);
builder.append("renderAutoAliasedDerivedTableExpressions", renderAutoAliasedDerivedTableExpressions);
builder.append("renderOptionalAssociativityParentheses", renderOptionalAssociativityParentheses);
builder.append("renderOptionalAsKeywordForTableAliases", renderOptionalAsKeywordForTableAliases);
@@ -9813,6 +9855,15 @@ public class Settings
return false;
}
}
+ if (renderNullifEmptyStringForBindValues == null) {
+ if (other.renderNullifEmptyStringForBindValues!= null) {
+ return false;
+ }
+ } else {
+ if (!renderNullifEmptyStringForBindValues.equals(other.renderNullifEmptyStringForBindValues)) {
+ return false;
+ }
+ }
if (renderAutoAliasedDerivedTableExpressions == null) {
if (other.renderAutoAliasedDerivedTableExpressions!= null) {
return false;
@@ -11733,6 +11784,7 @@ public class Settings
result = ((prime*result)+((renderLocale == null)? 0 :renderLocale.hashCode()));
result = ((prime*result)+((renderFormatted == null)? 0 :renderFormatted.hashCode()));
result = ((prime*result)+((renderFormatting == null)? 0 :renderFormatting.hashCode()));
+ result = ((prime*result)+((renderNullifEmptyStringForBindValues == null)? 0 :renderNullifEmptyStringForBindValues.hashCode()));
result = ((prime*result)+((renderAutoAliasedDerivedTableExpressions == null)? 0 :renderAutoAliasedDerivedTableExpressions.hashCode()));
result = ((prime*result)+((renderOptionalAssociativityParentheses == null)? 0 :renderOptionalAssociativityParentheses.hashCode()));
result = ((prime*result)+((renderOptionalAsKeywordForTableAliases == null)? 0 :renderOptionalAsKeywordForTableAliases.hashCode()));
diff --git a/jOOQ/src/main/java/org/jooq/impl/Val.java b/jOOQ/src/main/java/org/jooq/impl/Val.java
index 927bf6a021..a406e380b0 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Val.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Val.java
@@ -37,6 +37,7 @@
*/
package org.jooq.impl;
+import static java.lang.Boolean.TRUE;
import static java.util.stream.Collectors.joining;
// ...
import static org.jooq.conf.ParamType.INLINED;
@@ -44,7 +45,9 @@ import static org.jooq.conf.ParamType.NAMED;
import static org.jooq.conf.ParamType.NAMED_OR_INLINED;
import static org.jooq.impl.AbstractRowAsField.acceptMultisetContent;
import static org.jooq.impl.AbstractRowAsField.forceMultisetContent;
+import static org.jooq.impl.DSL.inline;
import static org.jooq.impl.DSL.sql;
+import static org.jooq.impl.Names.N_NULLIF;
import static org.jooq.impl.QueryPartListView.wrap;
import static org.jooq.impl.SQLDataType.OTHER;
import static org.jooq.impl.SQLDataType.VARCHAR;
@@ -215,7 +218,23 @@ final class Val:1 or @1