diff --git a/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java b/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java index b3e0a662c4..808cfad8fa 100644 --- a/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java +++ b/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java @@ -94,11 +94,12 @@ public interface LoaderOptionsStep extends LoaderSourceStep // ------------------------------------------------------------------------- /** - * Instruct the Loader to update duplicate records if the main - * unique key's value is already in the database. This is only supported if - * {@link InsertQuery#onDuplicateKeyUpdate(boolean)} is supported, too. + * Instruct the Loader to update duplicate records if any of + * the unique keys' values are already in the database. This is only + * supported if {@link InsertQuery#onDuplicateKeyUpdate(boolean)} is + * supported, too. *

- * If the loaded table does not have a primary key, then all records are + * If the loaded table does not have any unqiue keys, then all records are * inserted and this clause behaves like {@link #onDuplicateKeyIgnore()} *

* If you don't specify a behaviour, {@link #onDuplicateKeyError()} will be @@ -109,10 +110,10 @@ public interface LoaderOptionsStep extends LoaderSourceStep LoaderOptionsStep onDuplicateKeyUpdate(); /** - * Instruct the Loader to skip duplicate records if the main - * unique key's value is already in the database. + * Instruct the Loader to skip duplicate records if any of the + * unique keys' values are already in the database. *

- * If the loaded table does not have a primary key, then all records are + * If the loaded table does not have any unique keys, then all records are * inserted. This may influence the JDBC driver's outcome on * {@link Connection#getWarnings()}, depending on your JDBC driver's * implementation diff --git a/jOOQ/src/main/java/org/jooq/impl/LoaderImpl.java b/jOOQ/src/main/java/org/jooq/impl/LoaderImpl.java index 2ca78b1755..e5eff05886 100644 --- a/jOOQ/src/main/java/org/jooq/impl/LoaderImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/LoaderImpl.java @@ -626,21 +626,16 @@ final class LoaderImpl implements public final LoaderImpl execute() throws IOException { checkFlags(); - if (content == CONTENT_CSV) { + if (content == CONTENT_CSV) executeCSV(); - } - else if (content == CONTENT_XML) { + else if (content == CONTENT_XML) throw new UnsupportedOperationException(); - } - else if (content == CONTENT_JSON) { + else if (content == CONTENT_JSON) executeJSON(); - } - else if (content == CONTENT_ARRAYS) { + else if (content == CONTENT_ARRAYS) executeRows(); - } - else { + else throw new IllegalStateException(); - } return this; } @@ -729,8 +724,8 @@ final class LoaderImpl implements if (row.getClass() != Object[].class) row = Arrays.copyOf(row, row.length, Object[].class); - // [#5145] Lazy initialisation of fields off the first row - // in case LoaderFieldMapper was used. + // [#5145] Lazy initialisation of fields off the first row + // in case LoaderFieldMapper was used. if (fields == null) fields0(row);