From 1b9fc64906573318fe82071df95f15f5093f1035 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Wed, 1 Nov 2017 12:10:00 +0100 Subject: [PATCH] [#6771] Add a Setting to prevent UPDATE and DELETE statements that lack a WHERE clause --- jOOQ/src/main/java/org/jooq/Constants.java | 2 +- .../org/jooq/conf/ExecuteWithoutWhere.java | 51 +++ .../main/java/org/jooq/conf/MappedSchema.java | 2 +- .../main/java/org/jooq/conf/MappedTable.java | 2 +- .../java/org/jooq/conf/ObjectFactory.java | 4 +- .../java/org/jooq/conf/RenderFormatting.java | 2 +- .../java/org/jooq/conf/RenderMapping.java | 2 +- .../src/main/java/org/jooq/conf/Settings.java | 66 ++- .../java/org/jooq/conf/SettingsTools.java | 22 +- .../main/java/org/jooq/conf/package-info.java | 2 +- .../java/org/jooq/impl/AbstractDMLQuery.java | 27 ++ .../java/org/jooq/impl/AbstractQuery.java | 2 +- .../org/jooq/impl/ConditionProviderImpl.java | 12 +- .../java/org/jooq/impl/DeleteQueryImpl.java | 18 +- .../java/org/jooq/impl/InsertQueryImpl.java | 2 +- .../java/org/jooq/impl/SelectQueryImpl.java | 15 +- .../java/org/jooq/impl/UpdateQueryImpl.java | 13 +- .../main/resources/xjb/runtime/binding.xjb | 6 +- .../resources/xsd/jooq-runtime-3.11.0.xsd | 432 ++++++++++++++++++ 19 files changed, 648 insertions(+), 34 deletions(-) create mode 100644 jOOQ/src/main/java/org/jooq/conf/ExecuteWithoutWhere.java create mode 100644 jOOQ/src/main/resources/xsd/jooq-runtime-3.11.0.xsd diff --git a/jOOQ/src/main/java/org/jooq/Constants.java b/jOOQ/src/main/java/org/jooq/Constants.java index 8c0716fd0d..2b88f76eab 100644 --- a/jOOQ/src/main/java/org/jooq/Constants.java +++ b/jOOQ/src/main/java/org/jooq/Constants.java @@ -65,7 +65,7 @@ public final class Constants { /** * The current jooq-runtime XSD file name. */ - public static final String XSD_RUNTIME = "jooq-runtime-3.10.0.xsd"; + public static final String XSD_RUNTIME = "jooq-runtime-3.11.0.xsd"; /** * The current jooq-runtime XML namespace diff --git a/jOOQ/src/main/java/org/jooq/conf/ExecuteWithoutWhere.java b/jOOQ/src/main/java/org/jooq/conf/ExecuteWithoutWhere.java new file mode 100644 index 0000000000..8f12fc738b --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/conf/ExecuteWithoutWhere.java @@ -0,0 +1,51 @@ + + + + + + + + +package org.jooq.conf; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ExecuteWithoutWhere. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ExecuteWithoutWhere">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="IGNORE"/>
+ *     <enumeration value="LOG_DEBUG"/>
+ *     <enumeration value="LOG_INFO"/>
+ *     <enumeration value="LOG_WARN"/>
+ *     <enumeration value="THROW"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ExecuteWithoutWhere") +@XmlEnum +public enum ExecuteWithoutWhere { + + IGNORE, + LOG_DEBUG, + LOG_INFO, + LOG_WARN, + THROW; + + public String value() { + return name(); + } + + public static ExecuteWithoutWhere fromValue(String v) { + return valueOf(v); + } + +} diff --git a/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java b/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java index 4fd107b10e..027c145471 100644 --- a/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java +++ b/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java @@ -39,7 +39,7 @@ public class MappedSchema implements Serializable, Cloneable { - private final static long serialVersionUID = 31000L; + private final static long serialVersionUID = 31100L; protected String input; @XmlElement(type = String.class) @XmlJavaTypeAdapter(RegexAdapter.class) diff --git a/jOOQ/src/main/java/org/jooq/conf/MappedTable.java b/jOOQ/src/main/java/org/jooq/conf/MappedTable.java index 7977095b68..aaaefbcb92 100644 --- a/jOOQ/src/main/java/org/jooq/conf/MappedTable.java +++ b/jOOQ/src/main/java/org/jooq/conf/MappedTable.java @@ -35,7 +35,7 @@ public class MappedTable implements Serializable, Cloneable { - private final static long serialVersionUID = 31000L; + private final static long serialVersionUID = 31100L; protected String input; @XmlElement(type = String.class) @XmlJavaTypeAdapter(RegexAdapter.class) diff --git a/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java b/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java index 4f6ebf35f7..8315427b22 100644 --- a/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java +++ b/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java @@ -31,7 +31,7 @@ import javax.xml.namespace.QName; @XmlRegistry public class ObjectFactory { - private final static QName _Settings_QNAME = new QName("http://www.jooq.org/xsd/jooq-runtime-3.9.0.xsd", "settings"); + private final static QName _Settings_QNAME = new QName("http://www.jooq.org/xsd/jooq-runtime-3.11.0.xsd", "settings"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jooq.conf @@ -84,7 +84,7 @@ public class ObjectFactory { * Create an instance of {@link JAXBElement }{@code <}{@link Settings }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.9.0.xsd", name = "settings") + @XmlElementDecl(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.11.0.xsd", name = "settings") public JAXBElement createSettings(Settings value) { return new JAXBElement(_Settings_QNAME, Settings.class, null, value); } diff --git a/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java b/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java index 0a884265bc..d7e61f5434 100644 --- a/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java +++ b/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java @@ -33,7 +33,7 @@ public class RenderFormatting implements Serializable, Cloneable { - private final static long serialVersionUID = 31000L; + private final static long serialVersionUID = 31100L; @XmlElement(defaultValue = "\n") protected String newline = "\n"; @XmlElement(defaultValue = " ") diff --git a/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java b/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java index fef3664817..c17ce43c5e 100644 --- a/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java +++ b/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java @@ -37,7 +37,7 @@ public class RenderMapping implements Serializable, Cloneable { - private final static long serialVersionUID = 31000L; + private final static long serialVersionUID = 31100L; protected String defaultSchema; @XmlElementWrapper(name = "schemata") @XmlElement(name = "schema") diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java index 20a65c5459..12b89e48ab 100644 --- a/jOOQ/src/main/java/org/jooq/conf/Settings.java +++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java @@ -34,7 +34,7 @@ public class Settings implements Serializable, Cloneable { - private final static long serialVersionUID = 31000L; + private final static long serialVersionUID = 31100L; @XmlElement(defaultValue = "true") protected Boolean renderCatalog = true; @XmlElement(defaultValue = "true") @@ -98,6 +98,12 @@ public class Settings protected Boolean inListPadding = false; @XmlElement(defaultValue = ";") protected String delimiter = ";"; + @XmlElement(defaultValue = "LOG_DEBUG") + @XmlSchemaType(name = "string") + protected ExecuteWithoutWhere executeUpdateWithoutWhere = ExecuteWithoutWhere.LOG_DEBUG; + @XmlElement(defaultValue = "LOG_DEBUG") + @XmlSchemaType(name = "string") + protected ExecuteWithoutWhere executeDeleteWithoutWhere = ExecuteWithoutWhere.LOG_DEBUG; /** * Whether any catalog name should be rendered at all. @@ -834,6 +840,54 @@ public class Settings this.delimiter = 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. + * + * @return + * possible object is + * {@link ExecuteWithoutWhere } + * + */ + public ExecuteWithoutWhere getExecuteUpdateWithoutWhere() { + return executeUpdateWithoutWhere; + } + + /** + * Sets the value of the executeUpdateWithoutWhere property. + * + * @param value + * allowed object is + * {@link ExecuteWithoutWhere } + * + */ + public void setExecuteUpdateWithoutWhere(ExecuteWithoutWhere value) { + this.executeUpdateWithoutWhere = value; + } + + /** + * [#6771] Specifies whether DELETE statements are allowed to be executed lacking a WHERE clause. This has no effect on rendering the statements SQL string. + * + * @return + * possible object is + * {@link ExecuteWithoutWhere } + * + */ + public ExecuteWithoutWhere getExecuteDeleteWithoutWhere() { + return executeDeleteWithoutWhere; + } + + /** + * Sets the value of the executeDeleteWithoutWhere property. + * + * @param value + * allowed object is + * {@link ExecuteWithoutWhere } + * + */ + public void setExecuteDeleteWithoutWhere(ExecuteWithoutWhere value) { + this.executeDeleteWithoutWhere = value; + } + public Settings withRenderCatalog(Boolean value) { setRenderCatalog(value); return this; @@ -979,4 +1033,14 @@ public class Settings return this; } + public Settings withExecuteUpdateWithoutWhere(ExecuteWithoutWhere value) { + setExecuteUpdateWithoutWhere(value); + return this; + } + + public Settings withExecuteDeleteWithoutWhere(ExecuteWithoutWhere value) { + setExecuteDeleteWithoutWhere(value); + return this; + } + } diff --git a/jOOQ/src/main/java/org/jooq/conf/SettingsTools.java b/jOOQ/src/main/java/org/jooq/conf/SettingsTools.java index bff4a2e8c7..63d01c9bf3 100644 --- a/jOOQ/src/main/java/org/jooq/conf/SettingsTools.java +++ b/jOOQ/src/main/java/org/jooq/conf/SettingsTools.java @@ -178,6 +178,22 @@ public final class SettingsTools { return settings.getRenderMapping(); } + /** + * Lazy access to {@link Settings#getExecuteUpdateWithoutWhere()}. + */ + public static final ExecuteWithoutWhere getExecuteUpdateWithoutWhere(Settings settings) { + ExecuteWithoutWhere result = settings.getExecuteUpdateWithoutWhere(); + return result == null ? ExecuteWithoutWhere.LOG_DEBUG : result; + } + + /** + * Lazy access to {@link Settings#getExecuteDeleteWithoutWhere()}. + */ + public static final ExecuteWithoutWhere getExecuteDeleteWithoutWhere(Settings settings) { + ExecuteWithoutWhere result = settings.getExecuteDeleteWithoutWhere(); + return result == null ? ExecuteWithoutWhere.LOG_DEBUG : result; + } + /** * Retrieve the configured default settings. *

@@ -214,7 +230,7 @@ public final class SettingsTools { * Return timeout if it is not 0, or the specified * {@link Settings#getQueryTimeout()}. */ - public static int getQueryTimeout(int timeout, Settings settings) { + public static final int getQueryTimeout(int timeout, Settings settings) { return timeout != 0 ? timeout : settings.getQueryTimeout() != null @@ -226,7 +242,7 @@ public final class SettingsTools { * Return maxRows if it is not 0, or the specified * {@link Settings#getMaxRows()}. */ - public static int getMaxRows(int maxRows, Settings settings) { + public static final int getMaxRows(int maxRows, Settings settings) { return maxRows != 0 ? maxRows : settings.getMaxRows() != null @@ -238,7 +254,7 @@ public final class SettingsTools { * Return fetchSize if it is not 0, or the specified * {@link Settings#getFetchSize()}. */ - public static int getFetchSize(int fetchSize, Settings settings) { + public static final int getFetchSize(int fetchSize, Settings settings) { return fetchSize != 0 ? fetchSize : settings.getFetchSize() != null diff --git a/jOOQ/src/main/java/org/jooq/conf/package-info.java b/jOOQ/src/main/java/org/jooq/conf/package-info.java index cc0fa74690..d36780b4da 100644 --- a/jOOQ/src/main/java/org/jooq/conf/package-info.java +++ b/jOOQ/src/main/java/org/jooq/conf/package-info.java @@ -5,5 +5,5 @@ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.9.0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.11.0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.jooq.conf; diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java index 93faceb883..10177a9cd4 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java @@ -90,8 +90,11 @@ import org.jooq.Result; import org.jooq.SQLDialect; import org.jooq.Table; import org.jooq.UpdateQuery; +import org.jooq.conf.ExecuteWithoutWhere; import org.jooq.conf.RenderNameStyle; +import org.jooq.exception.DataAccessException; import org.jooq.impl.Tools.DataKey; +import org.jooq.tools.JooqLogger; import org.jooq.tools.jdbc.JDBCUtils; /** @@ -103,6 +106,7 @@ abstract class AbstractDMLQuery extends AbstractQuery { * Generated UID */ private static final long serialVersionUID = -7438014075226919192L; + private static final JooqLogger log = JooqLogger.getLogger(AbstractQuery.class); @@ -314,6 +318,29 @@ abstract class AbstractDMLQuery extends AbstractQuery { abstract void accept0(Context ctx); + /** + * [#6771] Handle the case where a statement is executed without a WHERE clause. + */ + void executeWithoutWhere(String message, ExecuteWithoutWhere executeWithoutWhere) { + switch (executeWithoutWhere) { + case IGNORE: + break; + case LOG_DEBUG: + if (log.isDebugEnabled()) + log.debug(message, "A statement is executed without WHERE clause"); + break; + case LOG_INFO: + if (log.isInfoEnabled()) + log.info(message, "A statement is executed without WHERE clause"); + break; + case LOG_WARN: + log.warn(message, "A statement is executed without WHERE clause"); + break; + case THROW: + throw new DataAccessException("A statement is executed without WHERE clause"); + } + } + final void toSQLReturning(Context ctx) { if (!returning.isEmpty()) { switch (ctx.family()) { diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java index 0955923c1f..8ad599c301 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java @@ -457,7 +457,7 @@ abstract class AbstractQuery extends AbstractQueryPart implements Query { * method. */ @Override - public boolean isExecutable() { + public /* non-final */ boolean isExecutable() { return true; } diff --git a/jOOQ/src/main/java/org/jooq/impl/ConditionProviderImpl.java b/jOOQ/src/main/java/org/jooq/impl/ConditionProviderImpl.java index d24d5b287f..9a15a975ab 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ConditionProviderImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ConditionProviderImpl.java @@ -64,7 +64,11 @@ final class ConditionProviderImpl extends AbstractQueryPart implements Condition } final Condition getWhere() { - return condition == null ? trueCondition() : condition; + return hasWhere() ? condition : trueCondition(); + } + + final boolean hasWhere() { + return condition != null; } // ------------------------------------------------------------------------- @@ -88,10 +92,10 @@ final class ConditionProviderImpl extends AbstractQueryPart implements Condition @Override public final void addConditions(Operator operator, Condition conditions) { - if (getWhere() instanceof TrueCondition) - condition = conditions; - else + if (hasWhere()) condition = DSL.condition(operator, getWhere(), conditions); + else + condition = conditions; } @Override diff --git a/jOOQ/src/main/java/org/jooq/impl/DeleteQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/DeleteQueryImpl.java index 649cecf043..c434db744c 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DeleteQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/DeleteQueryImpl.java @@ -41,6 +41,7 @@ import static org.jooq.Clause.DELETE_RETURNING; import static org.jooq.Clause.DELETE_WHERE; import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; +import static org.jooq.conf.SettingsTools.getExecuteDeleteWithoutWhere; import static org.jooq.impl.Keywords.K_DELETE; import static org.jooq.impl.Keywords.K_FROM; import static org.jooq.impl.Keywords.K_WHERE; @@ -79,6 +80,10 @@ final class DeleteQueryImpl extends AbstractDMLQuery implem return condition.getWhere(); } + final boolean hasWhere() { + return condition.hasWhere(); + } + @Override public final void addConditions(Collection conditions) { condition.addConditions(conditions); @@ -133,11 +138,10 @@ final class DeleteQueryImpl extends AbstractDMLQuery implem .end(DELETE_DELETE) .start(DELETE_WHERE); - if (!(getWhere() instanceof TrueCondition)) { + if (hasWhere()) ctx.formatSeparator() .visit(K_WHERE).sql(' ') .visit(getWhere()); - } ctx.end(DELETE_WHERE) .start(DELETE_RETURNING); @@ -151,4 +155,14 @@ final class DeleteQueryImpl extends AbstractDMLQuery implem public final Clause[] clauses(Context ctx) { return CLAUSES; } + + @Override + public final boolean isExecutable() { + + // [#6771] Take action when DELETE query has no WHERE clause + if (!condition.hasWhere()) + executeWithoutWhere("DELETE without WHERE", getExecuteDeleteWithoutWhere(configuration().settings())); + + return super.isExecutable(); + } } diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java index 876891c933..39ecaa84e5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java @@ -276,7 +276,7 @@ final class InsertQueryImpl extends AbstractStoreQuery impl .visit(updateMap) .formatIndentLockEnd(); - if (!(condition.getWhere() instanceof TrueCondition)) + if (condition.hasWhere()) ctx.formatSeparator() .visit(K_WHERE) .sql(' ') diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java index e795106969..2aa7575dfc 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java @@ -1220,7 +1220,7 @@ final class SelectQueryImpl extends AbstractResultQuery imp // ------------ context.start(SELECT_WHERE); - if (getWhere().getWhere() instanceof TrueCondition && semiAntiJoinPredicates == null) + if (!getWhere().hasWhere() && semiAntiJoinPredicates == null) ; else { ConditionProviderImpl where = new ConditionProviderImpl(); @@ -1228,7 +1228,7 @@ final class SelectQueryImpl extends AbstractResultQuery imp if (semiAntiJoinPredicates != null) where.addConditions(semiAntiJoinPredicates); - if (!(getWhere().getWhere() instanceof TrueCondition)) + if (getWhere().hasWhere()) where.addConditions(getWhere()); context.formatSeparator() @@ -1247,23 +1247,21 @@ final class SelectQueryImpl extends AbstractResultQuery imp // syntax context.start(SELECT_START_WITH); - if (!(getConnectByStartWith().getWhere() instanceof TrueCondition)) { + if (getConnectByStartWith().hasWhere()) context.formatSeparator() .visit(K_START_WITH) .sql(' ') .visit(getConnectByStartWith()); - } context.end(SELECT_START_WITH); context.start(SELECT_CONNECT_BY); - if (!(getConnectBy().getWhere() instanceof TrueCondition)) { + if (getConnectBy().hasWhere()) { context.formatSeparator() .visit(K_CONNECT_BY); - if (connectByNoCycle) { + if (connectByNoCycle) context.sql(' ').visit(K_NOCYCLE); - } context.sql(' ').visit(getConnectBy()); } @@ -1315,12 +1313,11 @@ final class SelectQueryImpl extends AbstractResultQuery imp // ------------- context.start(SELECT_HAVING); - if (!(getHaving().getWhere() instanceof TrueCondition)) { + if (getHaving().hasWhere()) context.formatSeparator() .visit(K_HAVING) .sql(' ') .visit(getHaving()); - } context.end(SELECT_HAVING); diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java index 42daa7e110..fbe0b1e18b 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java @@ -46,6 +46,7 @@ import static org.jooq.Clause.UPDATE_WHERE; // ... import static org.jooq.SQLDialect.POSTGRES_10; // ... +import static org.jooq.conf.SettingsTools.getExecuteUpdateWithoutWhere; import static org.jooq.impl.DSL.select; import static org.jooq.impl.Keywords.K_FROM; import static org.jooq.impl.Keywords.K_ROW; @@ -495,6 +496,10 @@ final class UpdateQueryImpl extends AbstractStoreQuery impl return condition.getWhere(); } + final boolean hasWhere() { + return condition.hasWhere(); + } + @Override final void accept0(Context ctx) { boolean declareTables = ctx.declareTables(); @@ -616,11 +621,10 @@ final class UpdateQueryImpl extends AbstractStoreQuery impl ctx.start(UPDATE_WHERE); - if (!(getWhere() instanceof TrueCondition)) { + if (hasWhere()) ctx.formatSeparator() .visit(K_WHERE).sql(' ') .visit(getWhere()); - } ctx.end(UPDATE_WHERE) .start(UPDATE_RETURNING); @@ -637,6 +641,11 @@ final class UpdateQueryImpl extends AbstractStoreQuery impl @Override public final boolean isExecutable() { + + // [#6771] Take action when UPDATE query has no WHERE clause + if (!condition.hasWhere()) + executeWithoutWhere("UPDATE without WHERE", getExecuteUpdateWithoutWhere(configuration().settings())); + return updateMap.size() > 0 || multiRow != null; } } diff --git a/jOOQ/src/main/resources/xjb/runtime/binding.xjb b/jOOQ/src/main/resources/xjb/runtime/binding.xjb index a79ea9ca35..b4cbf92d10 100644 --- a/jOOQ/src/main/resources/xjb/runtime/binding.xjb +++ b/jOOQ/src/main/resources/xjb/runtime/binding.xjb @@ -12,16 +12,16 @@ - + - + - + org.jooq.conf.SettingsBase java.lang.Cloneable diff --git a/jOOQ/src/main/resources/xsd/jooq-runtime-3.11.0.xsd b/jOOQ/src/main/resources/xsd/jooq-runtime-3.11.0.xsd new file mode 100644 index 0000000000..96079a347c --- /dev/null +++ b/jOOQ/src/main/resources/xsd/jooq-runtime-3.11.0.xsd @@ -0,0 +1,432 @@ + + + + + + + + + + +Use this for single-catalog environments, or when all objects are made +available using synonyms]]> + + + + +Setting this to false also implicitly sets "renderCatalog" to false. +

+Use this for single-schema environments, or when all objects are made +available using synonyms]]> + + + + + + + + +This is set to "QUOTED" by default for backwards-compatibility]]> + + + + + + + + + + + + + + + + +Oracle 11g (and potentially, other databases too) implements scalar subquery caching. With this flag +set to true, users can automatically profit from this feature in all SQL statements.]]> + + + + + + + + +Possibilities include: + +- question marks +- named parameters +- named or inlined parameters +- inlined parameters + +This value is overridden by statementType == STATIC_STATEMENT, in +case of which, this defaults to INLINED]]> + + + + + + + + + + + + + + + + + + + + +This flag has no effect when "executeWithOptimisticLocking" is turned off.]]> + + + + + + + + +Setting this to "true" will allow for updating primary key values through +UpdatableRecord.store() and UpdatableRecord.update().]]> + + + + + + + + + + + + + + + + +Do note that only few databases support this feature. It is supported only in case the INSERT's or UPDATE's +RETURNING clause is fully supported, also for non-IDENTITY columns.]]> + + + + is active, also other values.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +This schema will be omitted in rendered SQL.]]> + + + + + + + + + + + + + + + + + + + + +Either <input/> or <inputExpression/> must be provided]]> + + + + or <inputExpression/> must be provided]]> + + + + +

  • When this is omitted, you can still apply table mapping.
  • +
  • When <input/> is provided, <output/> is a constant value.
  • +
  • When <inputExpression/> is provided, <output/> is a replacement expression
  • +]]> + + + + + + + + + + + + + + + + + + + + + or <inputExpression/> must be provided.]]> + + + + or <inputExpression/> must be provided]]> + + + + +
  • When <input/> is provided, <output/> is a constant value.
  • +
  • When <inputExpression/> is provided, <output/> is a replacement expression.
  • +]]>
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file