openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r802457 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-persistence-jdbc/src/main/ant/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/ openjpa-persistence-jdbc/src/test/java/org/apache/o...
Date Sat, 08 Aug 2009 21:03:57 GMT
Author: mikedd
Date: Sat Aug  8 21:03:56 2009
New Revision: 802457

URL: http://svn.apache.org/viewvc?rev=802457&view=rev
Log:
OPENJPA-651:
Default setting for RuntimeUnenhancedClasses = unsupported.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestDataCachingAndUnenhancedPropertyAccess.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestSimpleUnenhancedQuery.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMixedAccess.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lifecycle/TestPessimisticPNonTransToPDirty.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestMissingMetaData.java
    openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
    openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml
    openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
Sat Aug  8 21:03:56 2009
@@ -558,8 +558,8 @@
             "warn", String.valueOf(
                 RuntimeUnenhancedClassesModes.WARN),
         });
-        runtimeUnenhancedClasses.setDefault("supported");
-        runtimeUnenhancedClasses.setString("supported");
+        runtimeUnenhancedClasses.setDefault("unsupported");
+        runtimeUnenhancedClasses.setString("unsupported");
         runtimeUnenhancedClasses.setAliasListComprehensive(true);
 
         cacheMarshallerPlugins = (CacheMarshallersValue)

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml Sat Aug  8 21:03:56 2009
@@ -74,7 +74,6 @@
         <fileset id="enhance.path.ref"
                  dir="${project.build.testOutputDirectory}">
             <include name="**/*.class" />
-            <exclude name="**/Test*.class" />
             <exclude name="**/inheritance/serializable/*.class" />
             <exclude name="**/xml/*.class" />
             <exclude name="**/Unenhanced*.class" />
@@ -109,4 +108,4 @@
             <config log="DefaultLevel=${openjpa.loglevel}" />
         </openjpac>
     </target>
-</project>
\ No newline at end of file
+</project>

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestDataCachingAndUnenhancedPropertyAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestDataCachingAndUnenhancedPropertyAccess.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestDataCachingAndUnenhancedPropertyAccess.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestDataCachingAndUnenhancedPropertyAccess.java
Sat Aug  8 21:03:56 2009
@@ -30,9 +30,10 @@
 
     @Override
     public void setUp() {
-        setUp(UnenhancedIdentityIdPropertyAccess.class, CLEAR_TABLES,
+        setUp(UnenhancedIdentityIdPropertyAccess.class, CLEAR_TABLES, 
             "openjpa.DataCache", "true",
-            "openjpa.RemoteCommitProvider", "sjvm");
+            "openjpa.RemoteCommitProvider", "sjvm", 
+            "openjpa.RuntimeUnenhancedClasses", "supported");
     }
 
     public void testSimpleDataCacheOperation() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestSimpleUnenhancedQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestSimpleUnenhancedQuery.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestSimpleUnenhancedQuery.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestSimpleUnenhancedQuery.java
Sat Aug  8 21:03:56 2009
@@ -17,6 +17,9 @@
  */
 package org.apache.openjpa.enhance;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.persistence.EntityManager;
 
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
@@ -34,7 +37,7 @@
  */
 public class TestSimpleUnenhancedQuery extends SingleEMFTestCase {
 	public void setUp() throws Exception {
-		setUp(CLEAR_TABLES, UnenhancedPObject.class);
+		setUp(CLEAR_TABLES, UnenhancedPObject.class,"openjpa.RuntimeUnenhancedClasses", "supported");
 		EntityManager em = emf.createEntityManager();
 		em.getTransaction().begin();
 		em.persist(new UnenhancedPObject());

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMixedAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMixedAccess.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMixedAccess.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMixedAccess.java
Sat Aug  8 21:03:56 2009
@@ -27,7 +27,8 @@
 
     public void testMixedAccessEntityError() {
         try {
-            EntityManagerFactory emf = createEMF(UnenhancedMixedAccess.class);
+            EntityManagerFactory emf =
+                createEMF(UnenhancedMixedAccess.class, "openjpa.RuntimeUnenhancedClasses",
"supported");
             emf.createEntityManager().close();
         } catch (RuntimeException e) {
             String msg = e.getMessage();
@@ -40,7 +41,7 @@
     public void testInappropriateTransientError() {
         try {
             EntityManagerFactory emf = createEMF(
-                UnenhancedInappropriateTransient.class);
+                UnenhancedInappropriateTransient.class, "openjpa.RuntimeUnenhancedClasses",
"supported");
             emf.createEntityManager().close();
          } catch (RuntimeException e) {
             String msg = e.getMessage();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lifecycle/TestPessimisticPNonTransToPDirty.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lifecycle/TestPessimisticPNonTransToPDirty.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lifecycle/TestPessimisticPNonTransToPDirty.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lifecycle/TestPessimisticPNonTransToPDirty.java
Sat Aug  8 21:03:56 2009
@@ -31,7 +31,7 @@
     extends SingleEMTestCase {
 
     public void setUp() {
-        setUp(UnenhancedPropertyAccess.class, CLEAR_TABLES);
+        setUp(UnenhancedPropertyAccess.class, CLEAR_TABLES, "openjpa.RuntimeUnenhancedClasses",
"supported");
 
         UnenhancedPropertyAccess o = new UnenhancedPropertyAccess();
         EntityManager em = emf.createEntityManager();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestMissingMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestMissingMetaData.java?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestMissingMetaData.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestMissingMetaData.java
Sat Aug  8 21:03:56 2009
@@ -18,13 +18,16 @@
  */
 package org.apache.openjpa.persistence.simple;
 
-import org.apache.openjpa.persistence.ArgumentException;
-import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
-import org.apache.openjpa.persistence.OpenJPAPersistence;
+import java.util.HashMap;
+import java.util.Map;
 
 import junit.framework.TestCase;
 import junit.textui.TestRunner;
 
+import org.apache.openjpa.persistence.ArgumentException;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+
 // This test case extends TestCase directly instead of SingleEMTestCase with the
 // corresponding setup() method because that scheme goes down a different code
 // path and doesn't test the intended code change.
@@ -32,11 +35,13 @@
     private OpenJPAEntityManagerFactory emf;
 
     public void setUp() {
+        Map<String, String> props = new HashMap<String, String>();
+        props.put("openjpa.RuntimeUnenhancedClasses", "supported");
         // This test case uses a different persistence xml file because
         // modifying the current persistence.xml file with a bad class would
         // cause the TestEnhancementWithMultiplePUs test case to fail.
         emf = OpenJPAPersistence.createEntityManagerFactory(
-            "test-missing-metadata", "persistence2.xml");
+            "test-missing-metadata", "persistence2.xml", props);
     }
     
     public void testMissingMetaData() {
@@ -48,7 +53,7 @@
             fail("didn't receive expected ArgumentException - " + msg);
         } catch (Exception e) {
             assertEquals(ArgumentException.class,e.getClass());
-            assertTrue(e.getMessage().startsWith(msg));
+            assertTrue("Unexpected Exception : " + e.getMessage(), e.getMessage().startsWith(msg));
         }
     }
     

Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml Sat Aug  8 21:03:56 2009
@@ -2971,7 +2971,7 @@
             </para>
             <para>
                 <emphasis role="bold">Default: </emphasis>
-                <literal>supported</literal>
+                <literal>unsupported</literal>
                 
             </para>
             <para>
@@ -2994,6 +2994,12 @@
                 but will log a warning message.  
             </para>
             <para>
+                This function is often useful for rapid prototyping but is not
+                <emphasis role="italic">generally</emphasis>
+                recommended for use in production. Please consult the reference guide 
+                before changing the default value. 
+            </para>
+            <para>
                 See the reference guide section on unenhanced types for more 
                 information 
                 <xref linkend="ref_guide_pc_enhance_unenhanced_types"/>

Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml Sat Aug  8 21:03:56 2009
@@ -495,13 +495,23 @@
                 <para>
                 <note>
 Runtime Unenhanced Classes has some known limitations which are discussed below
-and documented in JIRA issues on the OpenJPA website. Support for this method 
-of automatic enhancement may be enabled or disabled via the 
-<xref linkend="openjpa.RuntimeUnenhancedClasses">
+and documented in JIRA issues on the OpenJPA website. As a result this option is
+disabled by default. Support for this method of automatic enhancement may be 
+enabled via the<xref linkend="openjpa.RuntimeUnenhancedClasses">
 openjpa.RuntimeUnenhancedClasses configuration </xref>option.
                 </note>
                 </para>
                 <para>
+To enable Runtime Unenhanced Classes for a specific persistence unit add the following property
to persistence.xml :
+<programlisting>
+<![CDATA[<properties> 
+    . . .
+    <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
+    . . .
+<properties>]]>
+</programlisting>
+                </para>
+                <para>
 If you are using <emphasis>property access</emphasis> for your persistent data,
 then OpenJPA will be able to track all accesses for instances that you load
 from the database, but not for instances that you create. This is because

Modified: openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml?rev=802457&r1=802456&r2=802457&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml (original)
+++ openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml Sat Aug  8 21:03:56 2009
@@ -68,9 +68,7 @@
 
         <fileset id="enhance.path.ref"
                  dir="${project.build.testOutputDirectory}">
-            <include name="**/Address.class" />
-            <include name="**/Person.class" />
-            <include name="**/PObject.class" />
+            <include name="**/*.class" />
             <exclude name="**/Test*.class" />
         </fileset>
         <openjpac>
@@ -79,4 +77,4 @@
             <config log="DefaultLevel=${openjpa.loglevel}" />
         </openjpac>
     </target>
-</project>
\ No newline at end of file
+</project>



Mime
View raw message