openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r702348 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/
Date Tue, 07 Oct 2008 05:15:06 GMT
Author: allee8285
Date: Mon Oct  6 22:15:05 2008
New Revision: 702348

URL: http://svn.apache.org/viewvc?rev=702348&view=rev
Log:
OPENJPA-732 - Re-commit the same original committed changes (code and tests) after test cases
corrections were made.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/Message.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=702348&r1=702347&r2=702348&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Mon
Oct  6 22:15:05 2008
@@ -1522,7 +1522,7 @@
                 _savepoints = new LinkedMap();
             } else {
                 if (_savepointCache == null)
-                    save.save(Collections.EMPTY_LIST);
+                    save.save(Collections.EMPTY_SET);
                 else {
                     save.save(_savepointCache);
                     _savepointCache.clear();
@@ -2190,7 +2190,7 @@
         if (hasTransactionalObjects())
             transStates = _transCache;
         else
-            transStates = Collections.EMPTY_LIST;
+            transStates = Collections.EMPTY_SET;
 
         // fire after rollback/commit event
         Collection mobjs = null;
@@ -2265,7 +2265,7 @@
 
         // now clear trans cache; keep cleared version rather than
         // null to avoid having to re-create the set later; more efficient
-        if (transStates != Collections.EMPTY_LIST) {
+        if (transStates != Collections.EMPTY_SET) {
             _transCache = (TransactionalCache) transStates;
             _transCache.clear();
         }
@@ -3310,7 +3310,7 @@
             Object obj;
             StateManagerImpl sm;
             ClassMetaData meta;
-            Collection sms = new ArrayList(objs.size());
+            Collection sms = new HashSet(objs.size());
             List exceps = null;
             for (Iterator itr = objs.iterator(); itr.hasNext();) {
                 obj = itr.next();
@@ -3637,7 +3637,7 @@
         try {
             assertActiveTransaction();
 
-            Collection sms = new ArrayList(objs.size());
+            Collection sms = new HashSet(objs.size());
             Object obj;
             StateManagerImpl sm;
             for (Iterator itr = objs.iterator(); itr.hasNext();) {
@@ -3784,7 +3784,7 @@
      */
     protected Collection getTransactionalStates() {
         if (!hasTransactionalObjects())
-            return Collections.EMPTY_LIST;
+            return Collections.EMPTY_SET;
         return _transCache.copy();
     }
 
@@ -3803,7 +3803,7 @@
      */
     protected Collection getDirtyStates() {
         if (!hasTransactionalObjects())
-            return Collections.EMPTY_LIST;
+            return Collections.EMPTY_SET;
 
         return _transCache.copyDirty();
     }
@@ -3814,8 +3814,8 @@
      */
     protected Collection getPendingTransactionalStates() {
         if (_pending == null)
-            return Collections.EMPTY_LIST;
-        return new ArrayList(_pending);
+            return Collections.EMPTY_SET;
+        return new HashSet(_pending);
     }
 
     /**
@@ -4036,19 +4036,19 @@
 
     public Collection getPersistedTypes() {
         if (_persistedClss == null || _persistedClss.isEmpty())
-            return Collections.EMPTY_LIST;
+            return Collections.EMPTY_SET;
         return Collections.unmodifiableCollection(_persistedClss);
     }
 
     public Collection getUpdatedTypes() {
         if (_updatedClss == null || _updatedClss.isEmpty())
-            return Collections.EMPTY_LIST;
+            return Collections.EMPTY_SET;
         return Collections.unmodifiableCollection(_updatedClss);
     }
 
     public Collection getDeletedTypes() {
         if (_deletedClss == null || _deletedClss.isEmpty())
-            return Collections.EMPTY_LIST;
+            return Collections.EMPTY_SET;
         return Collections.unmodifiableCollection(_deletedClss);
     }
 
@@ -4503,12 +4503,12 @@
          */
         public Collection copy() {
             if (isEmpty())
-                return Collections.EMPTY_LIST;
+                return Collections.EMPTY_SET;
 
             // size may not be entirely accurate due to refs expiring, so
             // manually copy each object; doesn't matter this way if size too
             // big by some
-            List copy = new ArrayList(size());
+            Set copy = new HashSet(size());
             if (_dirty != null)
                 for (Iterator itr = _dirty.iterator(); itr.hasNext();)
                     copy.add(itr.next());
@@ -4523,8 +4523,8 @@
          */
         public Collection copyDirty() {
             if (_dirty == null || _dirty.isEmpty())
-                return Collections.EMPTY_LIST;
-            return new ArrayList(_dirty);
+                return Collections.EMPTY_SET;
+            return new HashSet(_dirty);
         }
 
         /**

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/Message.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/Message.java?rev=702348&r1=702347&r2=702348&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/Message.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/Message.java
Mon Oct  6 22:15:05 2008
@@ -23,6 +23,7 @@
 import javax.persistence.Basic;
 import javax.persistence.Entity;
 import javax.persistence.EntityListeners;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Version;
 
@@ -35,7 +36,8 @@
 @EntityListeners(value = MessageListenerImpl.class)
 public class Message {
     @Id
-    private long id = System.currentTimeMillis();
+    @GeneratedValue
+    private long id;
 
     @Basic
     private String message;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java?rev=702348&r1=702347&r2=702348&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
Mon Oct  6 22:15:05 2008
@@ -26,7 +26,7 @@
 public class TestMessageListeners extends SingleEMFTestCase {
 
     public void setUp() {
-        setUp(CLEAR_TABLES);
+        setUp(DROP_TABLES);
     }
 
     @Override
@@ -96,7 +96,6 @@
     }
 
     public void testUpdateInPreUpdate() {
-        if( false ) {
         // Create a new EntityManager from the EntityManagerFactory. The
         // EntityManager is the main object in the persistence API, and is
         // used to create, delete, and query objects, as well as access
@@ -166,7 +165,6 @@
             if (em != null && em.isOpen())
                 em.close();
         }
-        }
     }
 
     private void assertStatus(int prePersist, int postPersist, int preUpdate,



Mime
View raw message