openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r900236 - in /openjpa/trunk: openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
Date Sun, 17 Jan 2010 22:47:48 GMT
Author: faywang
Date: Sun Jan 17 22:47:47 2010
New Revision: 900236

URL: http://svn.apache.org/viewvc?rev=900236&view=rev
Log:
OPENJPA-782: element collection field in orm.xml should not be serialized

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java?rev=900236&r1=900235&r2=900236&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
Sun Jan 17 22:47:47 2010
@@ -39,7 +39,7 @@
 public class TestEmbeddableXml extends SingleEMFTestCase {
    
     public int numEmbeddables = 1;
-    public int numBasicTypes = 1;
+    public int numBasicTypes = 10;
     public int ID = 1;
     public int deptId = 1;
     public int empId = 1;
@@ -156,6 +156,14 @@
         EntityManager em = emf.createEntityManager();
         EntityA_Coll_StringXml a = em.find(EntityA_Coll_StringXml.class, ID);
         checkEntityA_Coll_StringXml(a);
+        
+        Query q = em.createNativeQuery("select count(*) from EntityA_Coll_StringXml_nickNames");
+        Object obj = q.getSingleResult();
+        // ensure that multiple rows are inserted into the table (the column is not serialized)
+        assertEquals(numBasicTypes, obj);          
+        
+        
+        
         em.close();
     }
 

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java?rev=900236&r1=900235&r2=900236&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
Sun Jan 17 22:47:47 2010
@@ -1569,6 +1569,7 @@
         if (val != null)
             fmd.setInDefaultFetchGroup("EAGER".equals(val));
         fmd.setElementCollection(true);
+        fmd.setSerialized(false);
         if (JavaTypes.maybePC(fmd.getElement()) && !fmd.getElement().getDeclaredType().isEnum())
{
             fmd.getElement().setEmbedded(true);
             if (fmd.getElement().getEmbeddedMetaData() == null)



Mime
View raw message