openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1197988 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query: TestNamedQueries.java common/apps/QueryTest1.java
Date Sat, 05 Nov 2011 16:52:27 GMT
Author: curtisr7
Date: Sat Nov  5 16:52:27 2011
New Revision: 1197988

URL: http://svn.apache.org/viewvc?rev=1197988&view=rev
Log:
OPENJPA-2065: Add unit test for passing an interface as a result type.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/common/apps/QueryTest1.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java?rev=1197988&r1=1197987&r2=1197988&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java
Sat Nov  5 16:52:27 2011
@@ -28,8 +28,11 @@ package org.apache.openjpa.persistence.q
 
 import java.util.Collection;
 
+import javax.persistence.TypedQuery;
 
 
+
+import org.apache.openjpa.persistence.query.common.apps.EntityInterface;
 import org.apache.openjpa.persistence.query.common.apps.QueryTest1;
 
 import org.apache.openjpa.meta.QueryMetaData;
@@ -110,4 +113,11 @@ public class TestNamedQueries extends Ba
         query.closeAll();
         endEm(pm);
     }
+    
+    public void testInterfaceResultClass() {
+        OpenJPAEntityManager pm = getEM();
+
+        TypedQuery<EntityInterface> query = pm.createNamedQuery("named", EntityInterface.class);
+        assertEquals(10, query.getResultList().size());
+    }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/common/apps/QueryTest1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/common/apps/QueryTest1.java?rev=1197988&r1=1197987&r2=1197988&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/common/apps/QueryTest1.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/common/apps/QueryTest1.java
Sat Nov  5 16:52:27 2011
@@ -45,7 +45,7 @@ import javax.persistence.NamedQuery;
 @NamedQuery(name = "systemjdoql",
     query = "select o FROM QueryTest1 where o.numb == 4")
     })
-public class QueryTest1 {
+public class QueryTest1 implements EntityInterface {
 
     /*
       * Changed Variable names : Afam Okeke



Mime
View raw message