/** * Executes the query and returns the result as a list iterator; make sure to close it to close the underlying * cursor. The cursor is closed once the iterator is fully iterated through. */ public CloseableListIterator<T> listIterator() { return listLazyUncached().listIteratorAutoClose(); }
public void testAutoClose() { insert(10); LazyList<TestEntity> lazyList = dao.queryBuilder().build().listLazyUncached(); CloseableListIterator<TestEntity> iterator = lazyList.listIteratorAutoClose(); while (iterator.hasNext()) { assertFalse(lazyList.isClosed()); iterator.next(); } assertTrue(lazyList.isClosed()); }
/** * Executes the query and returns the result as a list iterator; make sure to close it to close the underlying * cursor. The cursor is closed once the iterator is fully iterated through. */ public CloseableListIterator<T> listIterator() { return listLazyUncached().listIteratorAutoClose(); }