[#2811] Deprecate ResultQuery.fetchLazy(int) - fetchSize is now passed to ResultQuery.fetchSize() not only for lazy fetching

This commit is contained in:
Lukas Eder 2013-10-28 17:56:03 +01:00
parent 759cab3fc4
commit 267ba0faa9
4 changed files with 8 additions and 3 deletions

View File

@ -1638,7 +1638,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// ---------------------------------------------------------------------
// A regular pass through the cursor
// ---------------------------------------------------------------------
Cursor<B> cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLazy(fetchSize);
Cursor<B> cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchSize(fetchSize).fetchLazy();
assertTrue(cursor.hasNext());
assertTrue(cursor.hasNext());
@ -1680,7 +1680,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// ---------------------------------------------------------------------
// Prematurely closing the cursor
// ---------------------------------------------------------------------
cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLazy(fetchSize);
cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchSize(fetchSize).fetchLazy();
assertTrue(cursor.hasNext());
assertTrue(cursor.hasNext());
@ -1696,7 +1696,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// ---------------------------------------------------------------------
// Fetching several records at once
// ---------------------------------------------------------------------
cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLazy(fetchSize);
cursor = create().selectFrom(TBook()).orderBy(TBook_ID()).fetchSize(fetchSize).fetchLazy();
Result<B> fetch0 = cursor.fetch(0);
assertTrue(fetch0.isEmpty());

View File

@ -156,7 +156,10 @@ public interface ResultQuery<R extends Record> extends Query {
* @throws DataAccessException if something went wrong executing the query
* @see #fetchLazy()
* @see Statement#setFetchSize(int)
* @deprecated - [#2811] - 3.3.0 - Use {@link #fetchSize(int)} and
* {@link #fetchLazy()} instead.
*/
@Deprecated
Cursor<R> fetchLazy(int fetchSize) throws DataAccessException;
/**

View File

@ -342,6 +342,7 @@ abstract class AbstractResultQuery<R extends Record> extends AbstractQuery imple
}
@Override
@Deprecated
public final Cursor<R> fetchLazy(int size) {
lazy = true;
fetchSize = size;

View File

@ -1689,6 +1689,7 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
}
@Override
@Deprecated
public final Cursor<R> fetchLazy(int fetchSize) {
return getDelegate().fetchLazy(fetchSize);
}