No effective change - update javadoc for QueryIterator to use try with resources

This commit is contained in:
rob bygrave
2018-12-19 15:22:32 +13:00
parent e7811910e9
commit e611353163
+3 -5
View File
@@ -668,15 +668,13 @@ public interface Query<T> {
* .where().eq("status", Status.NEW)
* .order().asc("id");
*
* QueryIterator<Customer> it = query.findIterate();
* try {
* // use try with resources to ensure QueryIterator is closed
*
* try (QueryIterator<Customer> it = query.findIterate()) {
* while (it.hasNext()) {
* Customer customer = it.next();
* // do something with customer ...
* }
* } finally {
* // close the underlying resources
* it.close();
* }
*
* }</pre>