diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java index ef128ab2b9..f69cf09fbd 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java @@ -964,6 +964,13 @@ public class PostgresDatabase extends AbstractDatabase { + + + + + + + diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresTableDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresTableDefinition.java index 907d320325..0f799bd25f 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresTableDefinition.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresTableDefinition.java @@ -87,6 +87,8 @@ public class PostgresTableDefinition extends AbstractTableDefinition { PostgresDatabase database = (PostgresDatabase) getDatabase(); Field dataType = COLUMNS.DATA_TYPE; + Field precision = nvl(COLUMNS.DATETIME_PRECISION, COLUMNS.NUMERIC_PRECISION); + @@ -103,9 +105,7 @@ public class PostgresTableDefinition extends AbstractTableDefinition { nvl( COLUMNS.CHARACTER_MAXIMUM_LENGTH, when(COLUMNS.UDT_NAME.eq(inline("_varchar")), PG_ATTRIBUTE.ATTTYPMOD.sub(inline(4)))).as(COLUMNS.CHARACTER_MAXIMUM_LENGTH), - nvl( - COLUMNS.DATETIME_PRECISION, - COLUMNS.NUMERIC_PRECISION).as(COLUMNS.NUMERIC_PRECISION), + precision.as(COLUMNS.NUMERIC_PRECISION), COLUMNS.NUMERIC_SCALE, (database.is10() ? COLUMNS.IS_IDENTITY : val(null, String.class)).as(COLUMNS.IS_IDENTITY), // [#9200] only use IS_IDENTITY for ColumnDefinition#isIdentity() if diff --git a/jOOQ/src/main/java/org/jooq/Constants.java b/jOOQ/src/main/java/org/jooq/Constants.java index 8aa8e84e78..3ca3389245 100644 --- a/jOOQ/src/main/java/org/jooq/Constants.java +++ b/jOOQ/src/main/java/org/jooq/Constants.java @@ -69,7 +69,7 @@ public final class Constants { /** * The current jooq-runtime XSD file name. */ - public static final String XSD_RUNTIME = "jooq-runtime-3.13.0.xsd"; + public static final String XSD_RUNTIME = "jooq-runtime-3.14.0.xsd"; /** * The current jooq-runtime XML namespace. diff --git a/jOOQ/src/main/java/org/jooq/Record.java b/jOOQ/src/main/java/org/jooq/Record.java index aac13b52c8..e68fafb753 100644 --- a/jOOQ/src/main/java/org/jooq/Record.java +++ b/jOOQ/src/main/java/org/jooq/Record.java @@ -996,7 +996,7 @@ public interface Record extends Attachable, Comparable, Formattable { * @see #from(Object) * @see DefaultRecordMapper */ - @NotNull + @Nullable E into(Class type) throws MappingException; /** diff --git a/jOOQ/src/main/java/org/jooq/ResultQuery.java b/jOOQ/src/main/java/org/jooq/ResultQuery.java index 93ad7e7b39..ab0b067b92 100644 --- a/jOOQ/src/main/java/org/jooq/ResultQuery.java +++ b/jOOQ/src/main/java/org/jooq/ResultQuery.java @@ -1234,7 +1234,7 @@ extends * * @param The generic entity type. * @param type The entity type. - * @return The resulting value. This is never null. + * @return The resulting value. * @see Record#into(Class) * @see Result#into(Class) * @throws DataAccessException if something went wrong executing the query @@ -1244,7 +1244,7 @@ extends * @throws TooManyRowsException if the query returned more than one record * @see DefaultRecordMapper */ - @NotNull + @Nullable E fetchSingleInto(Class type) throws DataAccessException, MappingException, NoDataFoundException, TooManyRowsException; /** diff --git a/jOOQ/src/main/java/org/jooq/SelectForUpdateOfStep.java b/jOOQ/src/main/java/org/jooq/SelectForUpdateOfStep.java index 0331b13c14..6e3a0b26b2 100644 --- a/jOOQ/src/main/java/org/jooq/SelectForUpdateOfStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectForUpdateOfStep.java @@ -37,9 +37,6 @@ */ package org.jooq; -import org.jetbrains.annotations.*; - - // ... // ... // ... @@ -58,6 +55,8 @@ import static org.jooq.SQLDialect.POSTGRES; import java.util.Collection; +import org.jetbrains.annotations.NotNull; + /** * This type is used for the {@link Select}'s DSL API when selecting generic * {@link Record} types. diff --git a/jOOQ/src/main/java/org/jooq/conf/InterpreterSearchSchema.java b/jOOQ/src/main/java/org/jooq/conf/InterpreterSearchSchema.java index c2e22156b1..570bc4e946 100644 --- a/jOOQ/src/main/java/org/jooq/conf/InterpreterSearchSchema.java +++ b/jOOQ/src/main/java/org/jooq/conf/InterpreterSearchSchema.java @@ -28,7 +28,7 @@ public class InterpreterSearchSchema implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; protected String catalog; @XmlElement(required = true) protected String schema; diff --git a/jOOQ/src/main/java/org/jooq/conf/MappedCatalog.java b/jOOQ/src/main/java/org/jooq/conf/MappedCatalog.java index d6b1bb475a..41ccc9dc90 100644 --- a/jOOQ/src/main/java/org/jooq/conf/MappedCatalog.java +++ b/jOOQ/src/main/java/org/jooq/conf/MappedCatalog.java @@ -34,7 +34,7 @@ public class MappedCatalog implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; protected String input; @XmlElement(type = String.class) @XmlJavaTypeAdapter(RegexAdapter.class) diff --git a/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java b/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java index 8974c7f472..5499ab36c5 100644 --- a/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java +++ b/jOOQ/src/main/java/org/jooq/conf/MappedSchema.java @@ -34,7 +34,7 @@ public class MappedSchema implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; 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 d67f6f18f0..f69dc6188e 100644 --- a/jOOQ/src/main/java/org/jooq/conf/MappedTable.java +++ b/jOOQ/src/main/java/org/jooq/conf/MappedTable.java @@ -30,7 +30,7 @@ public class MappedTable implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; 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 cc335f4ea6..55a7d78e3a 100644 --- a/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java +++ b/jOOQ/src/main/java/org/jooq/conf/ObjectFactory.java @@ -24,7 +24,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.13.0.xsd", "settings"); + private final static QName _Settings_QNAME = new QName("http://www.jooq.org/xsd/jooq-runtime-3.14.0.xsd", "settings"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jooq.conf @@ -105,7 +105,7 @@ public class ObjectFactory { * @return * the new instance of {@link JAXBElement }{@code <}{@link Settings }{@code >} */ - @XmlElementDecl(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.13.0.xsd", name = "settings") + @XmlElementDecl(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.14.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/ParseSearchSchema.java b/jOOQ/src/main/java/org/jooq/conf/ParseSearchSchema.java index 9f3e3022f5..f5ffa739e9 100644 --- a/jOOQ/src/main/java/org/jooq/conf/ParseSearchSchema.java +++ b/jOOQ/src/main/java/org/jooq/conf/ParseSearchSchema.java @@ -28,7 +28,7 @@ public class ParseSearchSchema implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; protected String catalog; @XmlElement(required = true) protected String schema; diff --git a/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java b/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java index e288d59524..cc3e59ebe6 100644 --- a/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java +++ b/jOOQ/src/main/java/org/jooq/conf/RenderFormatting.java @@ -28,7 +28,7 @@ public class RenderFormatting implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; @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 01c82820fb..dd61f5e772 100644 --- a/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java +++ b/jOOQ/src/main/java/org/jooq/conf/RenderMapping.java @@ -32,7 +32,7 @@ public class RenderMapping implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; protected String defaultCatalog; protected String defaultSchema; @XmlElementWrapper(name = "catalogs") diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java index 38c2f239ce..0f9b8a57e9 100644 --- a/jOOQ/src/main/java/org/jooq/conf/Settings.java +++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java @@ -36,7 +36,7 @@ public class Settings implements Serializable, Cloneable, XMLAppendable { - private final static long serialVersionUID = 31200L; + private final static long serialVersionUID = 31400L; @XmlElement(defaultValue = "true") protected Boolean renderCatalog = true; @XmlElement(defaultValue = "true") @@ -147,6 +147,11 @@ public class Settings protected Boolean executeWithOptimisticLockingExcludeUnversioned = false; @XmlElement(defaultValue = "true") protected Boolean attachRecords = true; + @XmlElement(defaultValue = "true") + protected Boolean insertUnchangedRecords = true; + @XmlElement(defaultValue = "NEVER") + @XmlSchemaType(name = "string") + protected UpdateUnchangedRecords updateUnchangedRecords = UpdateUnchangedRecords.NEVER; @XmlElement(defaultValue = "false") protected Boolean updatablePrimaryKeys = false; @XmlElement(defaultValue = "true") @@ -1243,6 +1248,46 @@ public class Settings this.attachRecords = value; } + /** + * Whether {@link org.jooq.TableRecord#insert()} calls should be executed if the record is unchanged. This also affects the INSERT part of {@link org.jooq.UpdatableRecord#store()} and {@link org.jooq.UpdatableRecord#merge()} calls. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isInsertUnchangedRecords() { + return insertUnchangedRecords; + } + + /** + * Sets the value of the insertUnchangedRecords property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setInsertUnchangedRecords(Boolean value) { + this.insertUnchangedRecords = value; + } + + /** + * Whether {@link org.jooq.UpdatableRecord#update()} calls should be executed if the record is unchanged. This also affects the UPDATE part of {@link org.jooq.UpdatableRecord#store()} and {@link org.jooq.UpdatableRecord#merge()} calls. + * + */ + public UpdateUnchangedRecords getUpdateUnchangedRecords() { + return updateUnchangedRecords; + } + + /** + * Whether {@link org.jooq.UpdatableRecord#update()} calls should be executed if the record is unchanged. This also affects the UPDATE part of {@link org.jooq.UpdatableRecord#store()} and {@link org.jooq.UpdatableRecord#merge()} calls. + * + */ + public void setUpdateUnchangedRecords(UpdateUnchangedRecords value) { + this.updateUnchangedRecords = value; + } + /** * Whether primary key values are deemed to be "updatable" in jOOQ. *

@@ -2489,6 +2534,20 @@ public class Settings return this; } + public Settings withInsertUnchangedRecords(Boolean value) { + setInsertUnchangedRecords(value); + return this; + } + + /** + * Whether {@link org.jooq.UpdatableRecord#update()} calls should be executed if the record is unchanged. This also affects the UPDATE part of {@link org.jooq.UpdatableRecord#store()} and {@link org.jooq.UpdatableRecord#merge()} calls. + * + */ + public Settings withUpdateUnchangedRecords(UpdateUnchangedRecords value) { + setUpdateUnchangedRecords(value); + return this; + } + public Settings withUpdatablePrimaryKeys(Boolean value) { setUpdatablePrimaryKeys(value); return this; @@ -2879,6 +2938,8 @@ public class Settings builder.append("executeWithOptimisticLocking", executeWithOptimisticLocking); builder.append("executeWithOptimisticLockingExcludeUnversioned", executeWithOptimisticLockingExcludeUnversioned); builder.append("attachRecords", attachRecords); + builder.append("insertUnchangedRecords", insertUnchangedRecords); + builder.append("updateUnchangedRecords", updateUnchangedRecords); builder.append("updatablePrimaryKeys", updatablePrimaryKeys); builder.append("reflectionCaching", reflectionCaching); builder.append("cacheRecordMappers", cacheRecordMappers); @@ -3340,6 +3401,24 @@ public class Settings return false; } } + if (insertUnchangedRecords == null) { + if (other.insertUnchangedRecords!= null) { + return false; + } + } else { + if (!insertUnchangedRecords.equals(other.insertUnchangedRecords)) { + return false; + } + } + if (updateUnchangedRecords == null) { + if (other.updateUnchangedRecords!= null) { + return false; + } + } else { + if (!updateUnchangedRecords.equals(other.updateUnchangedRecords)) { + return false; + } + } if (updatablePrimaryKeys == null) { if (other.updatablePrimaryKeys!= null) { return false; @@ -3787,6 +3866,8 @@ public class Settings result = ((prime*result)+((executeWithOptimisticLocking == null)? 0 :executeWithOptimisticLocking.hashCode())); result = ((prime*result)+((executeWithOptimisticLockingExcludeUnversioned == null)? 0 :executeWithOptimisticLockingExcludeUnversioned.hashCode())); result = ((prime*result)+((attachRecords == null)? 0 :attachRecords.hashCode())); + result = ((prime*result)+((insertUnchangedRecords == null)? 0 :insertUnchangedRecords.hashCode())); + result = ((prime*result)+((updateUnchangedRecords == null)? 0 :updateUnchangedRecords.hashCode())); result = ((prime*result)+((updatablePrimaryKeys == null)? 0 :updatablePrimaryKeys.hashCode())); result = ((prime*result)+((reflectionCaching == null)? 0 :reflectionCaching.hashCode())); result = ((prime*result)+((cacheRecordMappers == null)? 0 :cacheRecordMappers.hashCode())); 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 6b77e7ed64..ca21842155 100644 --- a/jOOQ/src/main/java/org/jooq/conf/package-info.java +++ b/jOOQ/src/main/java/org/jooq/conf/package-info.java @@ -1,2 +1,2 @@ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.13.0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-runtime-3.14.0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.jooq.conf; diff --git a/jOOQ/src/main/java/org/jooq/impl/ForLock.java b/jOOQ/src/main/java/org/jooq/impl/ForLock.java index 336fbf4c34..c149249d5d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ForLock.java +++ b/jOOQ/src/main/java/org/jooq/impl/ForLock.java @@ -37,6 +37,7 @@ */ package org.jooq.impl; +// ... // ... // ... import static org.jooq.SQLDialect.DERBY; diff --git a/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java index 439e9cae6b..d7360765dd 100644 --- a/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java @@ -193,12 +193,18 @@ public class TableRecordImpl> extends AbstractRecord im InsertQuery insert = create.insertQuery(getTable()); addChangedValues(storeFields, insert, false); - // Don't store records if no value was set by client code if (!insert.isExecutable()) { - if (log.isDebugEnabled()) - log.debug("Query is not executable", insert); - return 0; + // Don't store records if no value was set by client code + if (FALSE.equals(create.settings().isInsertUnchangedRecords())) { + if (log.isDebugEnabled()) + log.debug("Query is not executable", insert); + + return 0; + } + + else + insert.setDefaultValues(); } // [#1596] Set timestamp and/or version columns to appropriate values diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java index 4e12707cb0..1fd365f39c 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java @@ -71,6 +71,7 @@ import org.jooq.TableField; import org.jooq.TableRecord; import org.jooq.UniqueKey; import org.jooq.UpdatableRecord; +import org.jooq.conf.UpdateUnchangedRecords; import org.jooq.exception.DataChangedException; import org.jooq.exception.NoDataFoundException; import org.jooq.tools.JooqLogger; @@ -284,16 +285,40 @@ public class UpdatableRecordImpl> extends TableReco || getTable().getRecordVersion() == null && getTable().getRecordTimestamp() == null && fetched; } + @SuppressWarnings({ "unchecked", "rawtypes" }) private final & org.jooq.ConditionProvider> int storeMergeOrUpdate0(Field[] storeFields, TableField[] keys, Q query, boolean merge) { addChangedValues(storeFields, query, merge); Tools.addConditions(query, this, keys); - // Don't store records if no value was set by client code if (!query.isExecutable()) { - if (log.isDebugEnabled()) - log.debug("Query is not executable", query); + switch (StringUtils.defaultIfNull(create().settings().getUpdateUnchangedRecords(), UpdateUnchangedRecords.NEVER)) { - return 0; + // Don't store records if no value was set by client code + case NEVER: + if (log.isDebugEnabled()) + log.debug("Query is not executable", query); + + return 0; + + case SET_PRIMARY_KEY_TO_ITSELF: + for (TableField key : keys) + query.addValue(key, (Field) key); + + break; + + case SET_NON_PRIMARY_KEY_TO_THEMSELVES: + for (Field field : storeFields) + query.addValue(field, (Field) field); + + break; + + case SET_NON_PRIMARY_KEY_TO_RECORD_VALUES: + for (Field field : storeFields) + changed(field, true); + + addChangedValues(storeFields, query, merge); + break; + } } // [#1596] Set timestamp and/or version columns to appropriate values diff --git a/jOOQ/src/main/resources/xsd/jooq-runtime-3.13.0.xsd b/jOOQ/src/main/resources/xsd/jooq-runtime-3.13.0.xsd deleted file mode 100644 index c3788e2f9a..0000000000 --- a/jOOQ/src/main/resources/xsd/jooq-runtime-3.13.0.xsd +++ /dev/null @@ -1,1047 +0,0 @@ - - - - - - - - - - -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 only affects names created through {@link org.jooq.impl.DSL#name(String)} methods (including those that are implicitly created through this method), not {@link org.jooq.impl.DSL#quotedName(String)} or {@link org.jooq.impl.DSL#unquotedName(String)}, whose behaviour cannot be overridden. -

-This setting does not affect any plain SQL usage.]]> - - - - -Names are modified irrespective of the {@link #getRenderQuotedNames()} setting. -

-This setting does not affect any plain SQL usage.]]> - - - - - - - -This is set to "QUOTED" by default for backwards-compatibility. -

-@deprecated - 3.12.0 - [#5909] - Use {@link RenderQuotedNames} and {@link RenderNameCase} instead.]]> - - @java.lang.Deprecated - @java.lang.Deprecated - - - - - - -Named parameter syntax defaults to :name (such as supported by Oracle, JPA, Spring), but -vendor specific parameters may look differently. This flag can be used to determine the prefix to be -used by named parameters, such as @ for SQL Server's @name or $ -for PostgreSQL's $name. -

-"Named indexed" parameters can be obtained in the same way by specifingy {@code ParamType#NAMED} and not -providing a name to parameters, resulting in :1 or @1 or $1, etc.]]> - - - - - - - - - - - -@deprecated - 3.12.0 - [#5909] - Use {@link RenderQuotedNames} and {@link RenderNameCase} instead.]]> - - @java.lang.Deprecated - @java.lang.Deprecated - - - - - - - - - - - - - - - - - - AS keyword in table aliases, if it is optional in the output dialect. This is ignored if the keyword is not supported (e.g. in Oracle)]]> - - - - AS keyword in table aliases, if it is optional in the output dialect.]]> - - - - INNER keyword in INNER JOIN, if it is optional in the output dialect.]]> - - - - OUTER keyword in OUTER JOIN, if it is optional in the output dialect.]]> - - - - -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.]]> - - - - ORDER BY rn clause should be rendered on emulated paginated queries. -

-Older databases did not support OFFSET .. FETCH pagination, so jOOQ emulates it using derived -tables and ROWNUM (Oracle 11g and older) or ROW_NUMBER() (e.g. DB2, -SQL Server, etc.) filtering. While these subqueries are ordered, the ordering is not -guaranteed to be stable in the outer most queries. It may be stable (and e.g. in Oracle, -it mostly is, if queries are not parallel, or joined to other queries, etc.), so the excess -ORDER BY clause may add some additional performance overhead. This setting forces -jOOQ to not generate the additional ORDER BY clause. -

-For details, see https://github.com/jOOQ/jOOQ/issues/7609.]]> - - - - RETURNING clause should map to SQL Server's OUTPUT clause. -

-SQL Server supports an OUTPUT clause in most DML statements, whose behaviour -is almost identical to RETURNING in Firebird, Oracle, PostgreSQL. Users who -want to prevent jOOQ from rendering this OUTPUT clause can deactivate this flag -to revert to jOOQ calling {@code java.sql.Statement#getGeneratedKeys()} instead, which -is only supported for single row inserts. -

-This OUTPUT clause does not support fetching trigger generated values. In order -to fetch trigger generated values, {@link #fetchTriggerValuesAfterSQLServerOutput} needs to -be enabled as well. -

-For details, see https://github.com/jOOQ/jOOQ/issues/4498.]]> - - - - -By default (i.e. when this setting is set to false jOOQ will only render parenthesis pairs around queries combined with set operators when required. -This is for example the case when set operators are nested, when non-associative operators like EXCEPT are used, or when the queries are rendered as derived tables. -

-When this setting is set to true the queries combined with set operators will always be surrounded by a parenthesis pair. -

-For details, see https://github.com/jOOQ/jOOQ/issues/3676 and https://github.com/jOOQ/jOOQ/issues/9751.]]> - - - - OUTPUT clause. -

-SQL Server OUTPUT statements do not support fetching trigger generated values. -This is a limitation of the {@link #renderOutputForSQLServerReturningClause}. An additional -MERGE statement can run a second query if (and only if) the primary key has been -included in the OUTPUT clause. -

-For details, see https://github.com/jOOQ/jOOQ/issues/4498.]]> - - - - -Historically, prior to ANSI join syntax, joins were implemented by listing tables in -the FROM clause and providing join predicates in the WHERE clause, possibly using vendor specific -operators like (+) (Oracle, DB2) or *= (SQL Server) for outer join -support. For backwards compatibility with older RDBMS versions, ANSI joins in jOOQ code may be -converted to equivalent table lists in generated SQL using this flag. -

-This flag has a limited implementation that supports inner joins (in most cases) and outer joins -(only for simple comparison predicates). -

-This feature is available in the commercial distribution only.]]> - - - - -(Very) historically, prior to ANSI join syntax, joins were implemented by listing tables in -the FROM clause and providing join predicates in the WHERE clause, possibly using vendor specific -operators like (+) (Oracle, DB2) or *= (SQL Server) for outer join -support. Migrating such join syntax is tedious. The jOOQ parser can parse the old syntax and -this flag enables the transformation to ANSI join syntax. -

-This flag has not been implemented yet! -

-This feature is available in the commercial distribution only.]]> - - - - - - - - -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]]> - - - - - - - - - - - - 0 uses the dialect defaults:

    -
  • {@link org.jooq.SQLDialect#ACCESS} : 768
  • -
  • {@link org.jooq.SQLDialect#ASE} : 2000
  • -
  • {@link org.jooq.SQLDialect#INGRES} : 1024
  • -
  • {@link org.jooq.SQLDialect#ORACLE} : 32767
  • -
  • {@link org.jooq.SQLDialect#POSTGRES} : 32767
  • -
  • {@link org.jooq.SQLDialect#SQLITE} : 999
  • -
  • {@link org.jooq.SQLDialect#SQLSERVER} : 2100
  • -
]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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 is a potentially destructive feature, which should not be turned on in production. It is useful mostly to quickly switch between branches in a development environment. This feature is available only in commercial distributions.]]> - - - - This is a potentially destructive feature, which should not be turned on in production. It is useful mostly to quickly revert any elements created in a development environment. This feature is available only in commercial distributions.]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SET key = value should be parsed rather than ignored.]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -This catalog will be omitted in rendered SQL.]]> - - - - -This schema will be omitted in rendered SQL.]]> - - - - -Either <catalogs/> or <schemata/> must be provided]]> - - - - -Either <catalogs/> or <schemata/> must be provided]]> - - - - - - - - - - - - - - - - -Either <input/> or <inputExpression/> must be provided]]> - - - - -Either <input/> or <inputExpression/> must be provided]]> - - - - -
  • When this is omitted, you can still apply schema and table mapping.
  • -
  • When <input/> is provided, <output/> is a constant value.
  • -
  • When <inputExpression/> is provided, <output/> is a replacement expression
  • -]]>
    -
    - - - - -
    -
    - - - - - - - - - - - - - -Either <input/> or <inputExpression/> must be provided]]> - - - - -Either <input/> 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
  • -]]>
    -
    - - - - -
    -
    - - - - - - - - - - - - - - -Either <input/> or <inputExpression/> must be provided.]]> - - - - -Either <input/> or <inputExpression/> must be provided]]> - - - - -
  • When <input/> is provided, <output/> is a constant value.
  • -
  • When <inputExpression/> is provided, <output/> is a replacement expression.
  • -]]>
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @java.lang.Deprecated - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @java.lang.Deprecated - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file