db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r220070 - in /incubator/jdo/trunk: fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java runtime20/src/java/org/apache/jdo/store/StoreManager.java
Date Thu, 21 Jul 2005 13:44:17 GMT
Author: mbo
Date: Thu Jul 21 06:44:16 2005
New Revision: 220070

URL: http://svn.apache.org/viewcvs?rev=220070&view=rev
Log:
Change StateManagerImpl to allow direct copy of oid values using JDOImplHelper

Modified:
    incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java

Modified: incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java?rev=220070&r1=220069&r2=220070&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java
(original)
+++ incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java
Thu Jul 21 06:44:16 2005
@@ -430,6 +430,13 @@
     }
 
     /**
+     * @see org.apache.jdo.store.StoreManager#isMediationRequiredToCopyOid
+     */
+    public boolean isMediationRequiredToCopyOid() {
+        return true;
+    }
+
+    /**
     * @see org.apache.jdo.store.StoreManager#getPCClassForOid
     */
     public synchronized Class getPCClassForOid(Object objectId,

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java?rev=220070&r1=220069&r2=220070&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java
(original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java
Thu Jul 21 06:44:16 2005
@@ -251,8 +251,12 @@
 
         if (uoid == null) { // Requested by the store.
             initializePC();
-            myPC = jdoImplHelper.newInstance (myPCClass, this);
-            srm.copyKeyFieldsFromObjectId(this, myPCClass);
+            if (srm.isMediationRequiredToCopyOid()) {
+                myPC = jdoImplHelper.newInstance (myPCClass, this);
+                srm.copyKeyFieldsFromObjectId(this, myPCClass);
+            } else {
+                myPC = jdoImplHelper.newInstance (myPCClass, this, ioid);
+            }
             markPKFieldsAsLoaded();
 
         } else if (srm.hasActualPCClass(ioid)){

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java?rev=220070&r1=220069&r2=220070&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java (original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java Thu Jul
21 06:44:16 2005
@@ -210,6 +210,13 @@
     */
     public Class getPCClassForOid(Object oid, PersistenceManagerInternal pm);
 
+    /**
+     * Indicates whether mediation from store manager is required to copy oid.
+     * @return <code>true</code> if mediation is required; <code>false</code>
+     * otherwise.
+     */
+    public boolean isMediationRequiredToCopyOid();
+
     /**  
     * Returns true if actual Class for a PersistenceCapable instance can be
     * resolved only in the database.



Mime
View raw message