[#4815] Relax bound from <R extends TableRecord<R>> to <R extends Record> for DSLContext.loadInto()

This commit is contained in:
lukaseder 2015-12-17 10:39:14 +01:00
parent 6c1fc75aff
commit 87b9316226
14 changed files with 15 additions and 16 deletions

View File

@ -399,7 +399,7 @@ public interface DSLContext extends Scope /* [java-8] */, AutoCloseable /* [/jav
* source.
*/
@Support
<R extends TableRecord<R>> LoaderOptionsStep<R> loadInto(Table<R> table);
<R extends Record> LoaderOptionsStep<R> loadInto(Table<R> table);
// -------------------------------------------------------------------------
// XXX Plain SQL API

View File

@ -50,7 +50,7 @@ import java.util.List;
*
* @author Lukas Eder
*/
public interface Loader<R extends TableRecord<R>> {
public interface Loader<R extends Record> {
/**
* A list of errors that might have happened during the load.

View File

@ -48,7 +48,7 @@ package org.jooq;
*
* @author Lukas Eder
*/
public interface LoaderCSVOptionsStep<R extends TableRecord<R>> extends LoaderListenerStep<R> {
public interface LoaderCSVOptionsStep<R extends Record> extends LoaderListenerStep<R> {
/**
* Specify that a certain number of rows should be ignored from the CSV

View File

@ -50,7 +50,7 @@ import java.util.Collection;
*
* @author Lukas Eder
*/
public interface LoaderCSVStep<R extends TableRecord<R>> {
public interface LoaderCSVStep<R extends Record> {
/**
* Specify the the fields to be loaded into the table in the correct order.

View File

@ -49,7 +49,7 @@ package org.jooq;
* @author Lukas Eder
* @author Johannes Bühler
*/
public interface LoaderJSONOptionsStep<R extends TableRecord<R>> extends LoaderListenerStep<R> {
public interface LoaderJSONOptionsStep<R extends Record> extends LoaderListenerStep<R> {
/**
* Specify that a certain number of rows should be ignored from the JSON

View File

@ -51,7 +51,7 @@ import java.util.Collection;
* @author Lukas Eder
* @author Johannes Bühler
*/
public interface LoaderJSONStep<R extends TableRecord<R>> {
public interface LoaderJSONStep<R extends Record> {
/**
* Specify the the fields to be loaded into the table in the correct order.

View File

@ -48,7 +48,7 @@ package org.jooq;
*
* @author Lukas Eder
*/
public interface LoaderListenerStep<R extends TableRecord<R>> extends LoaderLoadStep<R> {
public interface LoaderListenerStep<R extends Record> extends LoaderLoadStep<R> {
/**
* Specify a listener that is invoked whenever a row has been processed.

View File

@ -50,7 +50,7 @@ import java.io.IOException;
*
* @author Lukas Eder
*/
public interface LoaderLoadStep<R extends TableRecord<R>> {
public interface LoaderLoadStep<R extends Record> {
/**
* Execute the load. All exceptions are caught and wrapped in the resulting

View File

@ -69,7 +69,7 @@ import java.sql.Connection;
*
* @author Lukas Eder
*/
public interface LoaderOptionsStep<R extends TableRecord<R>> extends LoaderSourceStep<R> {
public interface LoaderOptionsStep<R extends Record> extends LoaderSourceStep<R> {
// -------------------------------------------------------------------------
// Duplicate handling

View File

@ -50,7 +50,7 @@ import java.util.Collection;
*
* @author Lukas Eder
*/
public interface LoaderRowsStep<R extends TableRecord<R>> {
public interface LoaderRowsStep<R extends Record> {
/**
* Specify the the fields to be loaded into the table in the correct order.

View File

@ -60,7 +60,7 @@ import org.xml.sax.InputSource;
* @author Lukas Eder
* @author Johannes Bühler
*/
public interface LoaderSourceStep<R extends TableRecord<R>> {
public interface LoaderSourceStep<R extends Record> {
/**
* Load in-memory data.

View File

@ -48,7 +48,7 @@ package org.jooq;
*
* @author Lukas Eder
*/
public interface LoaderXMLStep<R extends TableRecord<R>> {
public interface LoaderXMLStep<R extends Record> {
// [...] This API is not yet defined

View File

@ -534,7 +534,7 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
// -------------------------------------------------------------------------
@Override
public <R extends TableRecord<R>> LoaderOptionsStep<R> loadInto(Table<R> table) {
public <R extends Record> LoaderOptionsStep<R> loadInto(Table<R> table) {
return new LoaderImpl<R>(configuration(), table);
}

View File

@ -79,7 +79,6 @@ import org.jooq.LoaderXMLStep;
import org.jooq.Record;
import org.jooq.SelectQuery;
import org.jooq.Table;
import org.jooq.TableRecord;
import org.jooq.exception.DataAccessException;
import org.jooq.exception.LoaderConfigurationException;
import org.jooq.tools.StringUtils;
@ -92,7 +91,7 @@ import org.xml.sax.InputSource;
* @author Lukas Eder
* @author Johannes Bühler
*/
class LoaderImpl<R extends TableRecord<R>> implements
class LoaderImpl<R extends Record> implements
// Cascading interface implementations for Loader behaviour
LoaderOptionsStep<R>,
@ -144,7 +143,7 @@ class LoaderImpl<R extends TableRecord<R>> implements
private int bulk = BULK_NONE;
private int bulkAfter = 1;
private int content = CONTENT_CSV;
private final InputDelay data = new InputDelay();
private final InputDelay data = new InputDelay();
private Iterator<? extends Object[]> arrays;
// CSV configuration data