Improved signature of .fetchInto(RecordHandler) and .into(RecordHandler)

This commit is contained in:
Lukas Eder 2011-08-07 13:43:33 +00:00
parent 262dc319af
commit 9ed0e76740
5 changed files with 5 additions and 5 deletions

View File

@ -1726,6 +1726,6 @@ public interface Result<R extends Record> extends FieldProvider, List<R>, Attach
* @param handler The handler callback
* @return Convenience result, returning the parameter handler itself
*/
RecordHandler<R> into(RecordHandler<R> handler) throws SQLException;
<H extends RecordHandler<R>> H into(H handler) throws SQLException;
}

View File

@ -345,7 +345,7 @@ public interface ResultQuery<R extends Record> extends Query {
* @param handler The handler callback
* @return Convenience result, returning the parameter handler itself
*/
RecordHandler<R> fetchInto(RecordHandler<R> handler) throws SQLException;
<H extends RecordHandler<R>> H fetchInto(H handler) throws SQLException;
/**
* Fetch results asynchronously.

View File

@ -197,7 +197,7 @@ abstract class AbstractDelegatingSelect<R extends Record> extends AbstractQueryP
}
@Override
public final RecordHandler<R> fetchInto(RecordHandler<R> handler) throws SQLException {
public final <H extends RecordHandler<R>> H fetchInto(H handler) throws SQLException {
return query.fetchInto(handler);
}

View File

@ -295,7 +295,7 @@ abstract class AbstractResultQuery<R extends Record> extends AbstractQuery imple
}
@Override
public final RecordHandler<R> fetchInto(RecordHandler<R> handler) throws SQLException {
public final <H extends RecordHandler<R>> H fetchInto(H handler) throws SQLException {
return fetch().into(handler);
}

View File

@ -1185,7 +1185,7 @@ class ResultImpl<R extends Record> implements Result<R>, AttachableInternal {
}
@Override
public final RecordHandler<R> into(RecordHandler<R> handler) throws SQLException {
public final <H extends RecordHandler<R>> H into(H handler) throws SQLException {
for (R record : this) {
handler.next(record);
}