cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r726413 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/access/util/ main/java/org/apache/cayenne/dba/ main/java/...
Date Sun, 14 Dec 2008 11:23:45 GMT
Author: aadamchik
Date: Sun Dec 14 03:23:43 2008
New Revision: 726413

URL: http://svn.apache.org/viewvc?rev=726413&view=rev
Log:
fixing incorrect generics and obsolete methods names in the OperationObserver

all callbacks are now taking List<?>, not a List<DataRow> as the List can contain
scalars, Object[] and DataRows, depending on the query

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainFlushObserver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNodeQueryAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OperationObserver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/DefaultOperationObserver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/IteratedSelectObserver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataNode.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockOperationObserver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockQueryEngine.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainFlushObserver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainFlushObserver.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainFlushObserver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainFlushObserver.java
Sun Dec 14 03:23:43 2008
@@ -54,7 +54,7 @@
      * 
      * @since 1.2
      */
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
+    public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
 
         // read and close the iterator before doing anything else
         List<DataRow> keys;
@@ -139,10 +139,10 @@
     public void nextCount(Query query, int resultCount) {
     }
 
-    public void nextDataRows(Query query, List<DataRow> dataRows) {
+    public void nextRows(Query query, List<?> dataRows) {
     }
 
-    public void nextDataRows(Query q, ResultIterator it) {
+    public void nextRows(Query q, ResultIterator it) {
         throw new UnsupportedOperationException(
                 "'nextDataRows(Query,ResultIterator)' is unsupported (and unexpected) on
commit.");
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainLegacyQueryAction.java
Sun Dec 14 03:23:43 2008
@@ -132,16 +132,16 @@
         callback.nextBatchCount(queryForExecutedQuery(query), resultCount);
     }
 
-    public void nextDataRows(Query query, List dataRows) {
-        callback.nextDataRows(queryForExecutedQuery(query), dataRows);
+    public void nextRows(Query query, List<?> dataRows) {
+        callback.nextRows(queryForExecutedQuery(query), dataRows);
     }
 
-    public void nextDataRows(Query q, ResultIterator it) {
-        callback.nextDataRows(queryForExecutedQuery(q), it);
+    public void nextRows(Query q, ResultIterator it) {
+        callback.nextRows(queryForExecutedQuery(q), it);
     }
 
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
-        callback.nextGeneratedDataRows(queryForExecutedQuery(query), keysIterator);
+    public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
+        callback.nextGeneratedRows(queryForExecutedQuery(query), keysIterator);
     }
 
     public void nextQueryException(Query query, Exception ex) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
Sun Dec 14 03:23:43 2008
@@ -510,7 +510,7 @@
         fullResponse.addBatchUpdateCount(resultCount);
     }
 
-    public void nextDataRows(Query query, List<DataRow> dataRows) {
+    public void nextRows(Query query, List<?> dataRows) {
 
         // exclude prefetched rows in the main result
         if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery)
{
@@ -522,14 +522,14 @@
         }
     }
 
-    public void nextDataRows(Query q, ResultIterator it) {
+    public void nextRows(Query q, ResultIterator it) {
         throw new CayenneRuntimeException("Invalid attempt to fetch a cursor.");
     }
 
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
+    public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
         if (keysIterator != null) {
             try {
-                nextDataRows(query, (List<DataRow>) keysIterator.allRows());
+                nextRows(query, keysIterator.allRows());
             }
             catch (CayenneException ex) {
                 // don't throw here....

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNodeQueryAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNodeQueryAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNodeQueryAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNodeQueryAction.java
Sun Dec 14 03:23:43 2008
@@ -23,7 +23,6 @@
 import java.sql.SQLException;
 import java.util.List;
 
-import org.apache.cayenne.DataRow;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 
@@ -34,58 +33,57 @@
  * 
  * @since 1.2
  */
-class DataNodeQueryAction implements OperationObserver {
+class DataNodeQueryAction {
 
     OperationObserver observer;
     DataNode node;
 
-    private Query currentQuery;
-
     public DataNodeQueryAction(DataNode node, OperationObserver observer) {
         this.observer = observer;
         this.node = node;
     }
 
-    public void runQuery(Connection connection, Query query) throws SQLException,
-            Exception {
-
-        // remember root query ... it will be used to map the results, even if SQLAction
-        // uses query substitute...
-        this.currentQuery = query;
+    public void runQuery(Connection connection, final Query originalQuery)
+            throws SQLException, Exception {
 
-        SQLAction action = node.getAdapter().getAction(query, node);
-        action.performAction(connection, this);
-    }
-
-    public void nextBatchCount(Query query, int[] resultCount) {
-        observer.nextBatchCount(currentQuery, resultCount);
-    }
-
-    public void nextCount(Query query, int resultCount) {
-        observer.nextCount(currentQuery, resultCount);
-    }
-
-    public void nextDataRows(Query query, List<DataRow> dataRows) {
-        observer.nextDataRows(currentQuery, dataRows);
-    }
-
-    public void nextDataRows(Query q, ResultIterator it) {
-        observer.nextDataRows(currentQuery, it);
-    }
-
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
-        observer.nextGeneratedDataRows(currentQuery, keysIterator);
-    }
-
-    public void nextGlobalException(Exception ex) {
-        observer.nextGlobalException(ex);
-    }
-
-    public void nextQueryException(Query query, Exception ex) {
-        observer.nextQueryException(currentQuery, ex);
-    }
+        // wrap to ensure that the result is mapped back to the original query, even if
+        // the underlying SQLAction uses query substitute...
+        OperationObserver wrapper = new OperationObserver() {
+
+            public void nextBatchCount(Query query, int[] resultCount) {
+                observer.nextBatchCount(originalQuery, resultCount);
+            }
+
+            public void nextCount(Query query, int resultCount) {
+                observer.nextCount(originalQuery, resultCount);
+            }
+
+            public void nextRows(Query query, List<?> dataRows) {
+                observer.nextRows(originalQuery, dataRows);
+            }
+
+            public void nextRows(Query q, ResultIterator it) {
+                observer.nextRows(originalQuery, it);
+            }
+
+            public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
+                observer.nextGeneratedRows(originalQuery, keysIterator);
+            }
+
+            public void nextGlobalException(Exception ex) {
+                observer.nextGlobalException(ex);
+            }
+
+            public void nextQueryException(Query query, Exception ex) {
+                observer.nextQueryException(originalQuery, ex);
+            }
+
+            public boolean isIteratedResult() {
+                return observer.isIteratedResult();
+            }
+        };
 
-    public boolean isIteratedResult() {
-        return observer.isIteratedResult();
+        SQLAction action = node.getAdapter().getAction(originalQuery, node);
+        action.performAction(connection, wrapper);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
Sun Dec 14 03:23:43 2008
@@ -175,7 +175,7 @@
         node.performQueries(Collections.singleton((Query) query), new DefaultOperationObserver()
{
 
             @Override
-            public void nextDataRows(Query query, List dataRows) {
+            public void nextRows(Query query, List dataRows) {
                 result[0] = dataRows;
             }
         });

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OperationObserver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OperationObserver.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OperationObserver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OperationObserver.java
Sun Dec 14 03:23:43 2008
@@ -21,49 +21,47 @@
 
 import java.util.List;
 
-import org.apache.cayenne.DataRow;
 import org.apache.cayenne.query.Query;
 
 /**
- * Defines a set of callback methods that allow QueryEngine to pass back query results and
- * notify caller about exceptions.
- * 
- * @see org.apache.cayenne.access.QueryEngine
+ * Defines a set of callback methods that allow {@link QueryEngine} to pass back query
+ * results and notify caller about exceptions.
  */
-// TODO: need a name that better reflects the functionality,
-// e.g. OperationContext or QueryContext
 public interface OperationObserver extends OperationHints {
 
     /**
      * Callback method invoked after an updating query is executed.
      */
-    public void nextCount(Query query, int resultCount);
+    void nextCount(Query query, int resultCount);
 
     /**
      * Callback method invoked after a batch update is executed.
      */
-    public void nextBatchCount(Query query, int[] resultCount);
+    void nextBatchCount(Query query, int[] resultCount);
 
     /**
      * Callback method invoked for each processed ResultSet.
+     * 
+     * @since 3.0
      */
-    public void nextDataRows(Query query, List<DataRow> dataRows);
+    void nextRows(Query query, List<?> dataRows);
 
     /**
      * Callback method invoked for each opened ResultIterator. If this observer requested
      * results to be returned as a ResultIterator, this method is invoked instead of
-     * "nextDataRows(Query,List)". OperationObserver is responsible for closing the
-     * ResultIterators passed via this method.
+     * {@link #nextRows(Query, List)}.
+     * 
+     * @since 3.0
      */
-    public void nextDataRows(Query q, ResultIterator it);
+    void nextRows(Query q, ResultIterator it);
 
     /**
      * Callback method invoked after each batch of generated values is read during an
      * update.
      * 
-     * @since 1.2
+     * @since 3.0
      */
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator);
+    void nextGeneratedRows(Query query, ResultIterator keysIterator);
 
     /**
      * Callback method invoked on exceptions that happen during an execution of a specific

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
Sun Dec 14 03:23:43 2008
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.access;
 
 import java.util.ArrayList;
@@ -36,7 +35,6 @@
  * QueryResult encapsulates a result of execution of zero or more queries using
  * QueryEngine. QueryResult supports queries with multiple mixed selects and updates, such
  * as ProcedureQueries.
- * 
  */
 public class QueryResult extends DefaultOperationObserver {
 
@@ -68,8 +66,7 @@
     }
 
     /**
-     * Returns the first update count for the query. This is a shortcut for
-     * <code>(Integer)getUpdates(query).get(0)<code>, kind of like Google's "I'm
feeling lucky".
+     * Returns the first update count for the query. This is a shortcut for <code>(Integer)getUpdates(query).get(0)<code>,
kind of like Google's "I'm feeling lucky".
      * Returns -1 if no update count is found for the query.
      */
     public int getFirstUpdateCount(Query query) {
@@ -126,8 +123,7 @@
     }
 
     /**
-     * Returns the first results for the query. This is a shortcut for
-     * <code>(List)getRows(query).get(0)<code>, kind of like Google's "I'm feeling
lucky".
+     * Returns the first results for the query. This is a shortcut for <code>(List)getRows(query).get(0)<code>,
kind of like Google's "I'm feeling lucky".
      */
     public List getFirstRows(Query query) {
         List allResults = getResults(query);
@@ -151,7 +147,7 @@
      * by the query. ResultSets are returned in the oder they were obtained. Any updates
      * that were performed are not included.
      */
-    public List getRows(Query query) {
+    public List<?> getRows(Query query) {
         List allResults = getResults(query);
         int size = allResults.size();
         if (size == 0) {
@@ -249,8 +245,8 @@
     }
 
     @Override
-    public void nextDataRows(Query query, List dataRows) {
-        super.nextDataRows(query, dataRows);
+    public void nextRows(Query query, List<?> dataRows) {
+        super.nextRows(query, dataRows);
 
         List list = (List) queries.get(query);
         if (list == null) {
@@ -262,7 +258,7 @@
     }
 
     @Override
-    public void nextDataRows(Query q, ResultIterator it) {
+    public void nextRows(Query q, ResultIterator it) {
         throw new CayenneRuntimeException("Iterated results are not supported by "
                 + this.getClass().getName());
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
Sun Dec 14 03:23:43 2008
@@ -86,12 +86,12 @@
             QueryLogger
                     .logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
 
-            delegate.nextDataRows(query, resultRows);
+            delegate.nextRows(query, resultRows);
         }
         else {
             try {
                 resultReader.setClosingConnection(true);
-                delegate.nextDataRows(query, it);
+                delegate.nextRows(query, it);
             }
             catch (Exception ex) {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
Sun Dec 14 03:23:43 2008
@@ -300,6 +300,6 @@
                 keyRowDescriptor,
                 query.getMetaData(getEntityResolver()));
 
-        observer.nextGeneratedDataRows(query, iterator);
+        observer.nextGeneratedRows(query, iterator);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
Sun Dec 14 03:23:43 2008
@@ -216,7 +216,7 @@
         if (result != null && !result.isEmpty()) {
             // treat out parameters as a separate data row set
             QueryLogger.logSelectCount(1, System.currentTimeMillis() - t1);
-            delegate.nextDataRows(query, Collections.singletonList(result));
+            delegate.nextRows(query, Collections.singletonList(result));
         }
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
Sun Dec 14 03:23:43 2008
@@ -240,12 +240,12 @@
             QueryLogger.logSelectCount(resultRows.size(), System.currentTimeMillis()
                     - startTime);
 
-            callback.nextDataRows(query, resultRows);
+            callback.nextRows(query, resultRows);
         }
         else {
             try {
                 result.setClosingConnection(true);
-                callback.nextDataRows(query, it);
+                callback.nextRows(query, it);
             }
             catch (Exception ex) {
                 it.close();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
Sun Dec 14 03:23:43 2008
@@ -161,12 +161,12 @@
             QueryLogger
                     .logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
 
-            observer.nextDataRows(query, resultRows);
+            observer.nextRows(query, resultRows);
         }
         else {
             try {
                 workerIterator.setClosingConnection(true);
-                observer.nextDataRows(translator.getQuery(), it);
+                observer.nextRows(translator.getQuery(), it);
             }
             catch (Exception ex) {
                 it.close();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/DefaultOperationObserver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/DefaultOperationObserver.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/DefaultOperationObserver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/DefaultOperationObserver.java
Sun Dec 14 03:23:43 2008
@@ -22,7 +22,6 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -104,7 +103,7 @@
 
     }
 
-    public void nextDataRows(Query query, List dataRows) {
+    public void nextRows(Query query, List<?> dataRows) {
         // noop
     }
 
@@ -112,7 +111,7 @@
      * Closes ResultIterator without reading its data. If you implement a custom subclass,
      * only call super if closing the iterator is what you need.
      */
-    public void nextDataRows(Query query, ResultIterator it) {
+    public void nextRows(Query query, ResultIterator it) {
         if (it != null) {
             try {
                 it.close();
@@ -128,9 +127,9 @@
      * Closes ResultIterator without reading its data. If you implement a custom subclass,
      * only call super if closing the iterator is what you need.
      * 
-     * @since 1.2
+     * @since 3.0
      */
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
+    public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
         if (keysIterator != null) {
             try {
                 keysIterator.close();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/IteratedSelectObserver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/IteratedSelectObserver.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/IteratedSelectObserver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/util/IteratedSelectObserver.java
Sun Dec 14 03:23:43 2008
@@ -44,12 +44,12 @@
 	}
 
 	@Override
-    public void nextDataRows(Query query, List dataRows) {
+    public void nextRows(Query query, List<?> dataRows) {
 		throw new CayenneRuntimeException("Results unexpectedly returned as list.");
 	}
 
 	@Override
-    public void nextDataRows(Query q, ResultIterator it) {
+    public void nextRows(Query q, ResultIterator it) {
 	    // don't call super - it closes the iterator
 		resultIterator = it;
 	}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
Sun Dec 14 03:23:43 2008
@@ -438,7 +438,7 @@
             return id.intValue();
         }
 
-        public void nextDataRows(Query query, List<DataRow> dataRows) {
+        public void nextRows(Query query, List<?> dataRows) {
 
             // process selected object, issue an update query
             if (dataRows == null || dataRows.size() == 0) {
@@ -451,7 +451,7 @@
                         "Error generating PK : too many rows for entity: " + entityName);
             }
 
-            DataRow lastPk = dataRows.get(0);
+            DataRow lastPk = (DataRow) dataRows.get(0);
             id = (Number) lastPk.get("NEXT_ID");
         }
 
@@ -467,10 +467,10 @@
         public void nextBatchCount(Query query, int[] resultCount) {
         }
 
-        public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
+        public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
         }
 
-        public void nextDataRows(Query q, ResultIterator it) {
+        public void nextRows(Query q, ResultIterator it) {
         }
 
         public void nextQueryException(Query query, Exception ex) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
Sun Dec 14 03:23:43 2008
@@ -105,7 +105,7 @@
         if (result != null && !result.isEmpty()) {
             // treat out parameters as a separate data row set
             QueryLogger.logSelectCount(1, System.currentTimeMillis() - t1);
-            delegate.nextDataRows(query, Collections.singletonList(result));
+            delegate.nextRows(query, Collections.singletonList(result));
         }
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
Sun Dec 14 03:23:43 2008
@@ -26,7 +26,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.ResultIterator;
@@ -125,7 +124,7 @@
 
     class Observer implements OperationObserver {
 
-        List<List<DataRow>> results;
+        List<List<?>> results;
         List<Integer> counts;
         OperationObserver observer;
 
@@ -135,8 +134,8 @@
 
         void flushResults(Query query) {
             if (results != null) {
-                for (List<DataRow> result : results) {
-                    observer.nextDataRows(query, result);
+                for (List<?> result : results) {
+                    observer.nextRows(query, result);
                 }
                 results = null;
             }
@@ -163,26 +162,26 @@
             counts.add(Integer.valueOf(resultCount));
         }
 
-        public void nextDataRows(Query query, List<DataRow> dataRows) {
+        public void nextRows(Query query, List<?> dataRows) {
             // does not delegate to wrapped observer
             // but instead caches results locally.
             if (results == null) {
-                results = new ArrayList<List<DataRow>>();
+                results = new ArrayList<List<?>>();
             }
 
             results.add(dataRows);
         }
 
-        public void nextDataRows(Query q, ResultIterator it) {
-            observer.nextDataRows(q, it);
+        public void nextRows(Query q, ResultIterator it) {
+            observer.nextRows(q, it);
         }
 
         public void nextGlobalException(Exception ex) {
             observer.nextGlobalException(ex);
         }
 
-        public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
-            observer.nextGeneratedDataRows(query, keysIterator);
+        public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
+            observer.nextGeneratedRows(query, keysIterator);
         }
 
         public void nextQueryException(Query query, Exception ex) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataNode.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataNode.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataNode.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockDataNode.java
Sun Dec 14 03:23:43 2008
@@ -106,7 +106,7 @@
         Iterator it = queries.iterator();
         while (it.hasNext()) {
             Query query = (Query) it.next();
-            resultConsumer.nextDataRows(query, (List) results.get(query));
+            resultConsumer.nextRows(query, (List) results.get(query));
         }
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockOperationObserver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockOperationObserver.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockOperationObserver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockOperationObserver.java
Sun Dec 14 03:23:43 2008
@@ -52,7 +52,7 @@
         resultCounts.put(query, new Integer(resultCount));
     }
 
-    public void nextDataRows(Query query, List dataRows) {
+    public void nextRows(Query query, List<?> dataRows) {
         resultRows.put(query, dataRows);
     }
 
@@ -68,10 +68,10 @@
         throw new CayenneRuntimeException(ex);
     }
 
-    public void nextDataRows(Query q, ResultIterator it) {
+    public void nextRows(Query q, ResultIterator it) {
     }
 
-    public void nextGeneratedDataRows(Query query, ResultIterator keysIterator) {
+    public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
     }
 
     public boolean isIteratedResult() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockQueryEngine.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockQueryEngine.java?rev=726413&r1=726412&r2=726413&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockQueryEngine.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MockQueryEngine.java
Sun Dec 14 03:23:43 2008
@@ -87,7 +87,7 @@
         Iterator it = queries.iterator();
         while (it.hasNext()) {
             Query query = (Query) it.next();
-            resultConsumer.nextDataRows(query, (List) results.get(query));
+            resultConsumer.nextRows(query, (List) results.get(query));
         }
     }
 



Mime
View raw message