Improved signature of .fetchInto(RecordHandler) and .into(RecordHandler)
This commit is contained in:
parent
262dc319af
commit
9ed0e76740
@ -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;
|
||||
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user