cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [2/2] cayenne git commit: documenting the new iterator API
Date Sun, 25 Jan 2015 23:31:22 GMT
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 <aadamchik@apache.org>
Authored: Sun Jan 25 16:35:58 2015 -0500
Committer: aadamchik <aadamchik@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


Mime
View raw message