cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1499209 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne: ResultIterator.java access/ResultIterator.java
Date Wed, 03 Jul 2013 05:05:53 GMT
Author: aadamchik
Date: Wed Jul  3 05:05:53 2013
New Revision: 1499209

URL: http://svn.apache.org/r1499209
Log:
CAY-1829 Make ResultIterator implement Iterable<T>, create ObjectContext.iterate method

fixing inheritance hierarchy with the deprecated interface... this will
make deprecation meaningful

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ResultIterator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ResultIterator.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ResultIterator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ResultIterator.java?rev=1499209&r1=1499208&r2=1499209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ResultIterator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ResultIterator.java
Wed Jul  3 05:05:53 2013
@@ -31,7 +31,7 @@ import java.util.List;
  * Result "rows", depending on the query, may be represented as scalar values,
  * DataRows, or Object[] arrays containing a mix of scalars and DataRows.
  */
-public interface ResultIterator<T> extends Iterable<T> {
+public interface ResultIterator<T> extends org.apache.cayenne.access.ResultIterator<T>,
Iterable<T> {
 
     /**
      * Returns all yet unread rows from ResultSet without closing it.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ResultIterator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ResultIterator.java?rev=1499209&r1=1499208&r2=1499209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ResultIterator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ResultIterator.java
Wed Jul  3 05:05:53 2013
@@ -18,11 +18,48 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
+import java.util.List;
+
 /**
  * @deprecated since 3.2 moved to {@link org.apache.cayenne.ResultIterator} and
  *             significantly reworked.
  */
 @Deprecated
-public interface ResultIterator<T> extends org.apache.cayenne.ResultIterator<T>
{
+public interface ResultIterator<T> {
+    /**
+     * Returns all yet unread rows from ResultSet without closing it.
+     * 
+     * @since 3.0
+     */
+    List<T> allRows();
+
+    /**
+     * Returns true if there is at least one more record that can be read from
+     * the iterator.
+     */
+    boolean hasNextRow();
+
+    /**
+     * Returns the next result row that is, depending on the query, may be a
+     * scalar value, a DataRow, or an Object[] array containing a mix of scalars
+     * and DataRows.
+     * 
+     * @since 3.0
+     */
+    T nextRow();
+
+    /**
+     * Goes past current row. If the row is not needed, this may save some time
+     * on data conversion.
+     * 
+     * @since 3.0
+     */
+    void skipRow();
 
+    /**
+     * Closes ResultIterator and associated ResultSet. This method must be
+     * called explicitly when the user is finished processing the records.
+     * Otherwise unused database resources will not be released properly.
+     */
+    void close();
 }



Mime
View raw message