You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -403,23 +404,25 @@ public Builder extendWith(Extension extension) {
403
404
}
404
405
405
406
/**
406
-
* Set the default number of rows to return when fetching results from a query instead deriving fetch size from
407
-
* back pressure. If the value specified is zero, then the hint is ignored.
407
+
* Set the default number of rows to return when fetching results from a query. If the value specified is zero, then the hint is ignored and queries request all rows when running a statement.
408
408
*
409
409
* @param fetchSize the number of rows to fetch
410
410
* @return this {@code Builder}
411
+
* @throws IllegalArgumentException if {@code fetchSize} is negative
412
+
* @since 0.8.2
411
413
*/
412
414
publicBuilderfetchSize(intfetchSize) {
413
415
Assert.isTrue(fetchSize >= 0, "fetch size must be greater or equal zero");
414
-
this.fetchSize = sql -> fetchSize;
415
-
returnthis;
416
+
returnfetchSize(newFixedFetchSize(fetchSize));
416
417
}
417
418
418
419
/**
419
420
* Set a function that maps a SQL query to the number of rows to return when fetching results for that query.
420
421
*
421
422
* @param fetchSizeFunction a function that maps the number of rows to fetch
422
423
* @return this {@code Builder}
424
+
* @throws IllegalArgumentException if {@code fetchSizeFunction} is {@code null}
0 commit comments