You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2005/07/21 15:44:17 UTC

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

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.