openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r647026 - in /openjpa: branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
Date Fri, 11 Apr 2008 01:08:30 GMT
Author: fancy
Date: Thu Apr 10 18:08:29 2008
New Revision: 647026

URL: http://svn.apache.org/viewvc?rev=647026&view=rev
Log:
OPENJPA-547 add test strings for FETCH JOINs



Modified:
    openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java

Modified: openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java?rev=647026&r1=647025&r2=647026&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
(original)
+++ openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
Thu Apr 10 18:08:29 2008
@@ -147,4 +147,34 @@
 
         endEm(em);
     }
+
+    public void testInnerJoinFetch() {
+        EntityManager em = currentEntityManager();
+
+        String query = "SELECT s FROM Student " +
+            "s JOIN FETCH s.department";
+
+        List ls = (List) em.createQuery(query)
+            .getResultList();
+
+        assertNotNull(ls);
+        assertEquals(2, ls.size());
+
+        em.close();
+    }
+
+    public void testLeftJoinFetch() {
+        EntityManager em = currentEntityManager();
+
+        String query = "SELECT s FROM Student " +
+            "s LEFT JOIN FETCH s.department";
+
+        List ls = (List) em.createQuery(query)
+            .getResultList();
+
+        assertNotNull(ls);
+        assertEquals(4, ls.size());
+
+        em.close();
+    }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java?rev=647026&r1=647025&r2=647026&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java
Thu Apr 10 18:08:29 2008
@@ -147,4 +147,34 @@
 
         endEm(em);
     }
+
+    public void testInnerJoinFetch() {
+        EntityManager em = currentEntityManager();
+
+        String query = "SELECT s FROM Student " +
+            "s JOIN FETCH s.department";
+
+        List ls = (List) em.createQuery(query)
+            .getResultList();
+
+        assertNotNull(ls);
+        assertEquals(2, ls.size());
+
+        em.close();
+    }
+
+    public void testLeftJoinFetch() {
+        EntityManager em = currentEntityManager();
+
+        String query = "SELECT s FROM Student " +
+            "s LEFT JOIN FETCH s.department";
+
+        List ls = (List) em.createQuery(query)
+            .getResultList();
+
+        assertNotNull(ls);
+        assertEquals(4, ls.size());
+
+        em.close();
+    }
 }



Mime
View raw message