diff --git a/jOOQ/src/main/java/org/jooq/TableRecord.java b/jOOQ/src/main/java/org/jooq/TableRecord.java index f90baaea94..fd5cfec743 100644 --- a/jOOQ/src/main/java/org/jooq/TableRecord.java +++ b/jOOQ/src/main/java/org/jooq/TableRecord.java @@ -35,6 +35,8 @@ */ package org.jooq; +import java.sql.Statement; + import org.jooq.exception.DataAccessException; /** @@ -87,6 +89,13 @@ public interface TableRecord> extends Record { * SET [modified fields = modified values, excluding keys] * WHERE [key fields = key values] * + *

+ * If there is an IDENTITY column defined on the record's + * underlying table (see {@link Table#getIdentity()}), then the + * auto-generated IDENTITY value is refreshed automatically on + * INSERT's. Refreshing is done using + * {@link Statement#getGeneratedKeys()}, where this is supported by the JDBC + * driver. * * @param keys The key fields used for deciding whether to execute an * INSERT or UPDATE statement. If an diff --git a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java index f569b78ab8..a6e7f82a1b 100644 --- a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java +++ b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java @@ -35,6 +35,8 @@ */ package org.jooq; +import java.sql.Statement; + import org.jooq.exception.DataAccessException; /** @@ -112,6 +114,16 @@ public interface UpdatableRecord> extends Updatable * WHERE [main key fields = main key values] * *

+ * If there is an IDENTITY column defined on the record's + * underlying table (see {@link Table#getIdentity()}), then the + * auto-generated IDENTITY value is refreshed automatically on + * INSERT's. Similarly, all members of the primary key are + * refreshed, to ensure that trigger-generated values will be available + * after INSERT. Normally, primary key and + * IDENTITY columns coincide, but this doesn't have to be. + * Refreshing is done using {@link Statement#getGeneratedKeys()}, where this + * is supported by the JDBC driver. + *

* This is in fact the same as calling * store(getTable().getMainKey().getFieldsArray()) *