com.j256.ormlite.dao
Interface CloseableWrappedIterable<T>

All Superinterfaces:
CloseableIterable<T>, Iterable<T>
All Known Subinterfaces:
GenericRawResults<T>
All Known Implementing Classes:
CloseableWrappedIterableImpl, EagerForeignCollection, RawResultsImpl

public interface CloseableWrappedIterable<T>
extends CloseableIterable<T>

Extension to CloseableIterable which defines a class which has an iterator() method that returns a CloseableIterator but also can be closed itself. This allows us to do something like this pattern:

 CloseableWrappedIterable wrapperIterable = fooDao.getCloseableIterable();
 try {
   for (Foo foo : wrapperIterable) {
       ...
   }
 } finally {
   wrapperIterable.close();
 }
 

Author:
graywatson

Method Summary
 void close()
          This will close the last iterator returned by the Iterable.iterator() method.
 
Methods inherited from interface com.j256.ormlite.dao.CloseableIterable
closeableIterator
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

close

void close()
           throws SQLException
This will close the last iterator returned by the Iterable.iterator() method.

Throws:
SQLException


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.