[#8156] Wrong Javadoc on LoaderOptionsStep.onDuplicateKeyUpdate()

This commit is contained in:
lukaseder 2019-01-02 15:38:48 +01:00
parent 20d43aba97
commit 73be2e2f10
2 changed files with 15 additions and 19 deletions

View File

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

View File

@ -626,21 +626,16 @@ final class LoaderImpl<R extends Record> implements
public final LoaderImpl<R> 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<R extends Record> 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);