diff --git a/jOOQ/src/main/java/org/jooq/InsertSetMoreStep.java b/jOOQ/src/main/java/org/jooq/InsertSetMoreStep.java index ea6825af01..15ebf50c10 100644 --- a/jOOQ/src/main/java/org/jooq/InsertSetMoreStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertSetMoreStep.java @@ -37,9 +37,12 @@ */ package org.jooq; +import org.jooq.CheckReturnValue; +import org.jooq.Record; + import org.jetbrains.annotations.*; - +import java.util.Collection; import java.util.Map; /** @@ -141,6 +144,30 @@ public interface InsertSetMoreStep extends InsertOnDuplicateSt @Support InsertSetMoreStep set(Record record); + /** + * Set values in the INSERT statement. + *

+ * This is convenience for multiple calls to {@link #set(Record)} and + * {@link InsertSetMoreStep#newRecord()}. + * + * @see #set(Record) + */ + @NotNull @CheckReturnValue + @Support + InsertSetMoreStep set(Record... records); + + /** + * Set values in the INSERT statement. + *

+ * This is convenience for multiple calls to {@link #set(Record)} and + * {@link InsertSetMoreStep#newRecord()}. + * + * @see #set(Record) + */ + @NotNull @CheckReturnValue + @Support + InsertSetMoreStep set(Collection records); + /** * Add an additional record to the INSERT statement * diff --git a/jOOQ/src/main/java/org/jooq/InsertSetStep.java b/jOOQ/src/main/java/org/jooq/InsertSetStep.java index cccadc08ee..287cf9c5cc 100644 --- a/jOOQ/src/main/java/org/jooq/InsertSetStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertSetStep.java @@ -340,6 +340,30 @@ public interface InsertSetStep { @Support InsertSetMoreStep set(Record record); + /** + * Set values in the INSERT statement. + *

+ * This is convenience for multiple calls to {@link #set(Record)} and + * {@link InsertSetMoreStep#newRecord()}. + * + * @see #set(Record) + */ + @NotNull @CheckReturnValue + @Support + InsertSetMoreStep set(Record... records); + + /** + * Set values in the INSERT statement. + *

+ * This is convenience for multiple calls to {@link #set(Record)} and + * {@link InsertSetMoreStep#newRecord()}. + * + * @see #set(Record) + */ + @NotNull @CheckReturnValue + @Support + InsertSetMoreStep set(Collection records); + /** * Add values to the insert statement with implicit field names. */ diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java index 8fc7438708..193515380c 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java @@ -129,7 +129,9 @@ public interface InsertValuesStep1 extends InsertOnDuplica * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep1 extends InsertOnDuplica * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java index ec57a5d6db..05d0fbb4d7 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java @@ -129,7 +129,9 @@ public interface InsertValuesStep10Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep10Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java index 4a754a5db5..d63c42e586 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java @@ -129,7 +129,9 @@ public interface InsertValuesStep11Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep11Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java index adcb2063cc..bf2e177465 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java @@ -129,7 +129,9 @@ public interface InsertValuesStep12Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep12Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java index 2d49aeb692..65a97f90c9 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java @@ -129,7 +129,9 @@ public interface InsertValuesStep13Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep13Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java index deed5ceed5..72ed1460e0 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java @@ -129,7 +129,9 @@ public interface InsertValuesStep14Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep14Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java index 6ed7b62e71..6155aa2efd 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java @@ -129,7 +129,9 @@ public interface InsertValuesStep15Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep15Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java index 2a03b97bde..45e6222f5d 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java @@ -129,7 +129,9 @@ public interface InsertValuesStep16Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep16Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java index 049c688afa..fe4858cbbf 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java @@ -129,7 +129,9 @@ public interface InsertValuesStep17Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep17Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java index 2a8db28c51..b96e19b4ec 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java @@ -129,7 +129,9 @@ public interface InsertValuesStep18Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep18Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java index c6b586a282..e079e6bedd 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java @@ -129,7 +129,9 @@ public interface InsertValuesStep19Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep19Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java index d9a6623e3a..fb9d59c1e0 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java @@ -129,7 +129,9 @@ public interface InsertValuesStep2 extends InsertOnDup * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep2 extends InsertOnDup * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java index c62ac2b7e3..7f366d5163 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java @@ -129,7 +129,9 @@ public interface InsertValuesStep20Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep20Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java index 5001e67748..a98fe4fc26 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java @@ -129,7 +129,9 @@ public interface InsertValuesStep21Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep21Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java index bbf9675136..c5dd54f749 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java @@ -129,7 +129,9 @@ public interface InsertValuesStep22Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep22Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java index c0cbfbeca8..746b82fd32 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java @@ -129,7 +129,9 @@ public interface InsertValuesStep3 extends InsertO * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep3 extends InsertO * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java index e05ecaac83..fee2a654e8 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java @@ -129,7 +129,9 @@ public interface InsertValuesStep4 extends Ins * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep4 extends Ins * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java index 220504859e..ac94676dfb 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java @@ -129,7 +129,9 @@ public interface InsertValuesStep5 extends * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep5 extends * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java index bc8596830b..5ce35aec88 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java @@ -129,7 +129,9 @@ public interface InsertValuesStep6 ext * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep6 ext * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java index b79e5931ac..f398a1a87c 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java @@ -129,7 +129,9 @@ public interface InsertValuesStep7 * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep7 * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java index 99b467e7aa..3d81076c0c 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java @@ -129,7 +129,9 @@ public interface InsertValuesStep8Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep8Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java index c6cbb2fc0c..5a6827668b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java @@ -129,7 +129,9 @@ public interface InsertValuesStep9Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -145,7 +147,9 @@ public interface InsertValuesStep9Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java b/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java index d2b98c3c40..56a44f9139 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java @@ -128,7 +128,9 @@ public interface InsertValuesStepN extends InsertOnDuplicateSt * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support @@ -143,7 +145,9 @@ public interface InsertValuesStepN extends InsertOnDuplicateSt * Note: Irrespective of individual {@link Record#changed()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not - * by name. + * by name. If you prefer omitting unchanged values and adding values by field + * name rather than by index, use {@link InsertSetStep#set(Record...)} instead. + * That syntax is available only if you omit the explicit insert columns list. */ @NotNull @CheckReturnValue @Support diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java index 309f7e7116..36ccb6e206 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java @@ -1242,6 +1242,25 @@ final class InsertImpl records) { + for (Record record : records) + + // [#6373] [#7322] [#15455] + // A trailing newRecord() call is a no-op, but if users call set() twice with + // collections of records, then the expectation is for the two calls to be + // complete, i.e. no additional newRecord() calls should be needed in between + // the two + set(record).newRecord(); + + return this; + } + @Override public final InsertImpl setAllToExcluded() {