You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2015/01/26 00:31:22 UTC

[2/2] cayenne git commit: documenting the new iterator API

documenting the new iterator API


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/4357557d
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/4357557d
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/4357557d

Branch: refs/heads/master
Commit: 4357557ddf9da1a271195502137fdccae346611c
Parents: 30220d8
Author: aadamchik <aa...@apache.org>
Authored: Sun Jan 25 16:35:58 2015 -0500
Committer: aadamchik <aa...@apache.org>
Committed: Sun Jan 25 16:42:35 2015 -0500

----------------------------------------------------------------------
 .../cayenne-guide/src/docbkx/performance-tuning.xml  | 10 +++-------
 .../upgrade-guide/src/docbkx/new-features.xml        | 15 ++++++++++++++-
 2 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/4357557d/docs/docbook/cayenne-guide/src/docbkx/performance-tuning.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/performance-tuning.xml b/docs/docbook/cayenne-guide/src/docbkx/performance-tuning.xml
index b331e83..06b98ec 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/performance-tuning.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/performance-tuning.xml
@@ -218,13 +218,9 @@ finally {
         <para>Same thing with a
             callback:<programlisting>SelectQuery&lt;Artist> q = new SelectQuery&lt;Artist>(Artist.class);
 
-context.iterate(q, new ResultIteratorCallback&lt;Artist>() {
-    public void iterate(ResultIterator&lt;Artist> it) {
-        for(Artist a : it) {
-            // do something with the object...
-            ...
-        }
-    }
+context.iterate(q, (Artist a) -> {
+    // do something with the object...
+    ...
 });</programlisting></para>
     </section>
     <section xml:id="paginated-queries">

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4357557d/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/upgrade-guide/src/docbkx/new-features.xml b/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
index b2dcafd..b6777cd 100644
--- a/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
+++ b/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
@@ -85,7 +85,20 @@
                 
             </section>
         </section>
-        
+        <section xml:id="objectcontext">
+            <title>ObjectContext</title>
+            <section>
+            <title>Callback-based Object Iterator</title>
+            <para>ObjectContext now features a simpler way to iterate over large result sets, based
+                    on callback interface that can be implemented with a
+                    lambda:<programlisting>SelectQuery&lt;Artist> q = new SelectQuery&lt;Artist>(Artist.class);
+
+context.iterate(q, (Artist a) -> {
+    // do something with the object...
+    ...
+});</programlisting></para>
+            </section>
+        </section>
         <section>
             <title>Generics in Expressions and Queries</title>
             <para>We finished the work of "genericizing" Cayenne APIs started in 3.1. Now all APIs