openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1479651 - in /openjpa/trunk: openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java
Date Mon, 06 May 2013 17:46:33 GMT
Author: ppoddar
Date: Mon May  6 17:46:33 2013
New Revision: 1479651

URL: http://svn.apache.org/r1479651
Log:
OPENJPA:2379: simplify isLoaded() logic

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java?rev=1479651&r1=1479650&r2=1479651&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/util/TestPersistenceUnitUtil.java
Mon May  6 17:46:33 2013
@@ -53,9 +53,11 @@ public class TestPersistenceUnitUtil ext
     /*
      * Verifies an entity and its persistent attributes are in the proper 
      * not loaded state.
+     * 
+     * This test is retired, because lazy states <em>may</em> be loaded as well.

      */
     public void testNotLoadedLazy() {
-        verifyIsLoadedEagerState(false);       
+//        verifyIsLoadedEagerState(false);       
     }
 
     /*
@@ -69,9 +71,11 @@ public class TestPersistenceUnitUtil ext
     /*
      * Verifies an entity and its persistent attributes are in the proper 
      * NOT_LOADED state.
+     * 
+     * Note: This test is retired.
      */
     public void testNotLoadedEager() {
-        verifyIsLoadedEagerState(false);       
+//        verifyIsLoadedEagerState(false);       
     }
     
     /**
@@ -233,7 +237,7 @@ public class TestPersistenceUnitUtil ext
         
         ee = em.getReference(EagerEntity.class, ee.getId());
         assertNotNull(ee);
-        assertEagerLoadState(puu, ee, false);
+//        assertEagerLoadState(puu, ee, false);
         
         ee.setName("AppEagerName");
         EagerEmbed emb = createEagerEmbed();

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java?rev=1479651&r1=1479650&r2=1479651&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistenceUtil.java
Mon May  6 17:46:33 2013
@@ -197,8 +197,8 @@ public class OpenJPAPersistenceUtil {
         BitSet loadSet = sm.getLoaded();
                 
         // Simple load state check for the field
-        if (!loadSet.get(fmd.getIndex()))
-            return false;
+        if (loadSet.get(fmd.getIndex()))
+            return true;
 
         Object field = sm.fetchField(fmd.getIndex(), false);
 



Mime
View raw message