openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgras...@apache.org
Subject svn commit: r1641906 - /openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
Date Wed, 26 Nov 2014 19:51:32 GMT
Author: jgrassel
Date: Wed Nov 26 19:51:31 2014
New Revision: 1641906

URL: http://svn.apache.org/r1641906
Log:
OPENJPA-1988: openjpa does not process persistence unit default <cascade-persist>

Modified:
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java

Modified: openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java?rev=1641906&r1=1641905&r2=1641906&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
(original)
+++ openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
Wed Nov 26 19:51:31 2014
@@ -31,6 +31,26 @@ public class TestPUDefaultCascadePersist
         emf = OpenJPAPersistence.
                 createEntityManagerFactory("TestPUDefaultCascadePersist", 
                     "org/apache/openjpa/persistence/cascade/pudefault/META-INF/persistence.xml");
+        
+        EntityManager em = emf.createEntityManager();
+        try {
+            em.getTransaction().begin();
+            em.createQuery("DELETE FROM PUDEntityA01").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityA02").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityAE01").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityB").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityA01_PUDEntityB").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityA02_PUDEntityB").executeUpdate();
+            em.createQuery("DELETE FROM PUDEntityAE01_PUDEntityB").executeUpdate();
+            em.getTransaction().commit();
+        } catch (Throwable t) {
+            // Swallow
+        } finally {
+            if (em.getTransaction().isActive()) {
+                em.getTransaction().rollback();
+            }
+            em.close();
+        }
 //        super.setUp(PUDEntityA01.class, PUDEntityB.class,
 //            "org/apache/openjpa/persistence/cascade/pudefault/META-INF/cascadepersistorm.xml",
 //            CLEAR_TABLES);



Mime
View raw message