cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1486125 [3/3] - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/ main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/access/util/ test/ja...
Date Fri, 24 May 2013 17:31:14 GMT
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=1486125&r1=1486124&r2=1486125&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
Fri May 24 17:31:14 2013
@@ -25,19 +25,18 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.util.Util;
 
 /**
- * Simple implementation of OperationObserver interface. Useful as a superclass of other
- * implementations of OperationObserver. This implementation only tracks transaction
- * events and exceptions.
+ * Simple implementation of OperationObserver interface. Useful as a superclass
+ * of other implementations of OperationObserver. This implementation only
+ * tracks transaction events and exceptions.
  * <p>
- * <i>This operation observer is unsafe to use in application, since it doesn't rethrow
- * the exceptions immediately, and may cause the database to hang.</i>
+ * <i>This operation observer is unsafe to use in application, since it doesn't
+ * rethrow the exceptions immediately, and may cause the database to hang.</i>
  * </p>
  * 
  */
@@ -53,8 +52,7 @@ public class DefaultOperationObserver im
         if (globalExceptions.size() > 0) {
             if (globalExceptions.size() == 1) {
                 out.println("Global Exception:");
-            }
-            else {
+            } else {
                 out.println("Global Exceptions:");
             }
 
@@ -66,8 +64,7 @@ public class DefaultOperationObserver im
         if (queryExceptions.size() > 0) {
             if (queryExceptions.size() == 1) {
                 out.println("Query Exception:");
-            }
-            else {
+            } else {
                 out.println("Query Exceptions:");
             }
 
@@ -78,19 +75,25 @@ public class DefaultOperationObserver im
         }
     }
 
-    /** Returns a list of global exceptions that occured during data operation run. */
+    /**
+     * Returns a list of global exceptions that occured during data operation
+     * run.
+     */
     public List<Throwable> getGlobalExceptions() {
         return globalExceptions;
     }
 
-    /** Returns a list of exceptions that occured during data operation run by query. */
+    /**
+     * Returns a list of exceptions that occured during data operation run by
+     * query.
+     */
     public Map<Query, Throwable> getQueryExceptions() {
         return queryExceptions;
     }
 
     /**
-     * Returns <code>true</code> if at least one exception was registered during
query
-     * execution.
+     * Returns <code>true</code> if at least one exception was registered during
+     * query execution.
      */
     public boolean hasExceptions() {
         return globalExceptions.size() > 0 || queryExceptions.size() > 0;
@@ -108,36 +111,24 @@ public class DefaultOperationObserver im
     }
 
     /**
-     * Closes ResultIterator without reading its data. If you implement a custom subclass,
-     * only call super if closing the iterator is what you need.
+     * 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 nextRows(Query query, ResultIterator it) {
         if (it != null) {
-            try {
-                it.close();
-            }
-            catch (CayenneException ex) {
-                // don't throw here....
-                nextQueryException(query, ex);
-            }
+            it.close();
         }
     }
 
     /**
-     * Closes ResultIterator without reading its data. If you implement a custom subclass,
-     * only call super if closing the iterator is what you need.
+     * Closes ResultIterator without reading its data. If you implement a custom
+     * subclass, only call super if closing the iterator is what you need.
      * 
      * @since 3.0
      */
     public void nextGeneratedRows(Query query, ResultIterator keysIterator) {
         if (keysIterator != null) {
-            try {
-                keysIterator.close();
-            }
-            catch (CayenneException ex) {
-                // don't throw here....
-                nextQueryException(query, ex);
-            }
+            keysIterator.close();
         }
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockBaseContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockBaseContext.java?rev=1486125&r1=1486124&r2=1486125&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockBaseContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockBaseContext.java
Fri May 24 17:31:14 2013
@@ -21,10 +21,12 @@ package org.apache.cayenne;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.graph.GraphManager;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.Select;
 
 public class MockBaseContext extends BaseContext {
 
@@ -112,5 +114,10 @@ public class MockBaseContext extends Bas
     public QueryResponse onQuery(ObjectContext originatingContext, Query query) {
         return null;
     }
+    
+    @Override
+    public <T> ResultIterator<T> iterate(Select<T> query) {
+        return null;
+    }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java?rev=1486125&r1=1486124&r2=1486125&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
Fri May 24 17:31:14 2013
@@ -22,6 +22,7 @@ package org.apache.cayenne;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.graph.GraphManager;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
@@ -159,4 +160,8 @@ public class MockObjectContext implement
 
     public void setUserProperty(String key, Object value) {
     }
+    
+    public <T> ResultIterator<T> iterate(Select<T> query) {
+        return null;
+    }
 }



Mime
View raw message