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 22:53:30 UTC

svn commit: r220183 - in /incubator/jdo/trunk: fostore20/ fostore20/src/java/org/apache/jdo/impl/fostore/ runtime20/src/java/org/apache/jdo/impl/pm/ runtime20/src/java/org/apache/jdo/store/

Author: mbo
Date: Thu Jul 21 13:53:28 2005
New Revision: 220183

URL: http://svn.apache.org/viewcvs?rev=220183&view=rev
Log:
- Change fostore20 dependency from api11 to api20.
- The goal is to allow compiling fostore20 against api20, not to implement the
JDO2 added methods. The new methods all throw an UnsupportedOperationException.

Modified:
    incubator/jdo/trunk/fostore20/project.properties
    incubator/jdo/trunk/fostore20/project.xml
    incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreExtent.java
    incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStorePM.java
    incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreStoreManager.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/store/StoreManager.java

Modified: incubator/jdo/trunk/fostore20/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/project.properties?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/project.properties (original)
+++ incubator/jdo/trunk/fostore20/project.properties Thu Jul 21 13:53:28 2005
@@ -21,7 +21,7 @@
 maven.checkstyle.properties = ${basedir}/../jdo_checks.xml
 
 # dependencies
-jdo.jdoapi.jarfile = ${pom.getDependencyPath('apache-jdo:jdo1-api')}
+jdo.jdoapi.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-api')}
 jdo.jdobtree.jarfile = ${pom.getDependencyPath('apache-jdo:jdo-btree')}
 jdo.jdocore.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-core')}
 jdo.jdoenhancer.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-enhancer')}

Modified: incubator/jdo/trunk/fostore20/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/project.xml?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/project.xml (original)
+++ incubator/jdo/trunk/fostore20/project.xml Thu Jul 21 13:53:28 2005
@@ -37,7 +37,7 @@
     <dependencies>
         <dependency>
             <groupId>apache-jdo</groupId>
-            <artifactId>jdo1-api</artifactId>
+            <artifactId>jdo2-api</artifactId>
             <version>SNAPSHOT</version>
         </dependency>
         <dependency>

Modified: incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreExtent.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreExtent.java?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreExtent.java (original)
+++ incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStoreExtent.java Thu Jul 21 13:53:28 2005
@@ -25,6 +25,7 @@
 import java.util.NoSuchElementException;
 
 import javax.jdo.Extent;
+import javax.jdo.FetchPlan;
 import javax.jdo.JDOHelper;
 import javax.jdo.JDOException;
 import javax.jdo.JDOUserException;
@@ -149,6 +150,15 @@
                 iterators.remove(fit);
             }
         }
+    }
+
+    /** Get the fetch plan associated with this Extent.
+     * @return the fetch plan
+     * @since 2.0
+     */
+    public FetchPlan getFetchPlan() {
+        throw new UnsupportedOperationException(
+            "Method getFetchPlan() not yet implemented");
     }
 
     /**

Modified: incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStorePM.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStorePM.java?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStorePM.java (original)
+++ incubator/jdo/trunk/fostore20/src/java/org/apache/jdo/impl/fostore/FOStorePM.java Thu Jul 21 13:53:28 2005
@@ -76,6 +76,17 @@
          return this.jdoqlQueryFactory.newQuery(this, compiled);
      }
 
+    /** Create a Construct a new query instance using the specified String 
+     * as the single-string representation of the query.
+     * @param query the single-string query
+     * @return the new <code>Query</code>
+     * @since 2.0
+     */
+    public Query newQuery (String query) {
+        throw new UnsupportedOperationException(
+            "Method newQuery(String) not yet implemented");
+    }
+    
      /** Create a new Query using the specified language.
       * @param language the language of the query parameter
       * @param query the query, which is of a form determined by the language
@@ -157,4 +168,16 @@
            return this.jdoqlQueryFactory.newQuery(this, cln, filter);
      }
 
+    /**
+     * Create a new <code>Query</code> with the given candidate class
+     * from a named query. The query name given must be the name of a
+     * query defined in metadata.
+     * @param cls the <code>Class</code> of candidate instances
+     * @param queryName the name of the query to look up in metadata
+     * @return the new <code>Query</code>
+     */
+    public Query newNamedQuery (Class cls, String queryName) {
+        throw new UnsupportedOperationException(
+            "Method newNamedQuery(Class, String) not yet implemented");
+    }
 }

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=220183&r1=220182&r2=220183&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 13:53:28 2005
@@ -497,24 +497,24 @@
     }
 
     /** 
-     * This method returns an object id instance corresponding to the Class 
-     * and String arguments. The String argument might have been the 
-     * result of executing toString on an object id instance. 
-     * @param pcClass the Class of the persistence-capable instance
-     * @param str the String form of the object id
+     * This method returns an object id instance corresponding to the pcClass
+     * and key arguments.
+     * @param pcClass the <code>Class</code> of the persistence-capable instance
+     * @param key the value of the key field for single-field identity.
      * @return an instance of the object identity class
      */
-    public Object newObjectIdInstance (Class pcClass, String str) {
+    public Object newObjectIdInstance (Class pcClass, Object key) {
         Object rc = null;
         FOStoreModel model = pmf.getModel();
         JDOClass jdoClass = model.getJDOClass(pcClass);
         switch (jdoClass.getIdentityType()) {
           case JDOIdentityType.APPLICATION:
             //No need to create an AID here - it will not be used.
-            rc = jdoImplHelper.newObjectIdInstance(pcClass, str);
+            rc = jdoImplHelper.newObjectIdInstance(pcClass, key);
             break;
           case JDOIdentityType.DATASTORE:
-            rc = new OID(str);
+              // TBD: String representation to be passed to OID constructor
+              rc = new OID(key.toString());
             break;
           default:
             break;

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java (original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java Thu Jul 21 13:53:28 2005
@@ -38,12 +38,15 @@
 import java.util.Properties;
 import java.util.Set;
 
+import javax.jdo.FetchPlan;
 import javax.jdo.JDOException;
 import javax.jdo.JDOFatalInternalException;
 import javax.jdo.JDOFatalUserException;
 import javax.jdo.JDOUserException;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
+import javax.jdo.datastore.DataStoreCache;
+import javax.jdo.listener.InstanceLifecycleListener;
 import javax.jdo.spi.JDOPermission;
 
 import org.apache.commons.logging.Log;
@@ -383,6 +386,26 @@
         return multithreaded;
     }
 
+    /** Set the Mapping setting for this factory. This is used to find the 
+     * object-datastore mapping file(s).
+     *
+     * @param mapping the Mapping setting.
+     */
+    public void setMapping (String mapping) {
+        throw new UnsupportedOperationException(
+            "Method setMapping(String) is not yet implemented.");
+    }
+  
+    /** Get the Mapping setting for this factory.  This is used to find the 
+     * object-datastore mapping file(s).
+     *
+     * @return the Mapping setting.
+     */
+    public String getMapping () {
+        throw new UnsupportedOperationException(
+            "Method getMapping() is not yet implemented.");
+    }
+
     /**
      * Set the default Optimistic setting for all PersistenceManager instances
      * obtained from this factory.  Setting Optimistic to true also sets
@@ -634,6 +657,63 @@
     }
 
     /**
+     * Return the {@link DataStoreCache} that this factory uses for
+     * controlling a second-level cache. If this factory does not use
+     * a second-level cache, the returned instance does nothing. This
+     * method never returns <code>null</code>.
+     * @since 2.0
+     */
+    public DataStoreCache getDataStoreCache () {
+        throw new UnsupportedOperationException(
+            "Method getDataStoreCache() not yet implemented");
+    }
+
+    /**
+     * Add the parameter listener to the list of
+     * instance lifecycle event listeners set as the initial listeners
+     * for each PersistenceManager created by this PersistenceManagerFactory. 
+     * The <code>addInstanceLifecycleListener</code> and 
+     * <code>removeInstanceLifecycleListener</code>
+     * methods are considered to be configuration methods and
+     * can only be called when the PersistenceManagerFactory
+     * is configurable (before the first time {@link #getPersistenceManager}
+     * is called).
+     * <p>The <code>classes</code> parameter identifies all
+     * of the classes of interest. If the <code>classes</code>
+     * parameter is specified as <code>null</code>, events for all
+     * persistent classes and interfaces will be sent to the listener.</p>
+     * <p>The listener will be called for each event for which it
+     * implements the corresponding {@link InstanceLifecycleListener}
+     * interface.</p>
+     * @param listener the lifecycle listener
+     * @param classes the classes of interest to the listener
+     * @since 2.0
+     */
+    public void addInstanceLifecycleListener (
+        InstanceLifecycleListener listener, Class[] classes) {
+        throw new UnsupportedOperationException(
+            "Method addInstanceLifecycleListener(InstanceLifecycleListener, Class[]) not yet implemented");
+    }
+
+    /**
+     * Remove the parameter listener instance from the list of
+     * instance lifecycle event listeners set as the initial listeners
+     * for each PersistenceManager created by this PersistenceManagerFactory. 
+     * The <code>addInstanceLifecycleListener</code> and 
+     * <code>removeInstanceLifecycleListener</code>
+     * methods are considered to be configuration methods and
+     * can only be called when the PersistenceManagerFactory
+     * is configurable (before the first time {@link #getPersistenceManager}
+     * is called).
+     * @param listener the listener instance to be removed
+     * @since 2.0
+     */
+    public void removeInstanceLifecycleListener (InstanceLifecycleListener listener) {
+        throw new UnsupportedOperationException(
+            "Method removeInstanceLifecycleListener(InstanceLifecycleListener) not yet implemented");
+    }
+
+    /**
      * Returns an array of Strings indicating which options are supported by
      * this PersistenceManagerFactory.
      * @return the option array.
@@ -1607,6 +1687,19 @@
         }
     }
     
+    /** 
+     * A <code>PersistenceManagerFactory</code> instance can be used 
+     * until it is closed.
+     * @return <code>true</code> if this <code>PersistenceManagerFactory</code>
+     * has been closed.
+     * @see #close()
+     * @since 2.0
+     */
+    public boolean isClosed() {
+        throw new UnsupportedOperationException(
+            "Method isClosed() is not yet implemented.");
+    }
+
     /** Assert that this PersistenceManagerFactory is not closed.  This
      * assertion precedes all getPersistenceManager calls.  "set" methods
      * are already protected by the configured flag.

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java?rev=220183&r1=220182&r2=220183&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java (original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java Thu Jul 21 13:53:28 2005
@@ -528,19 +528,18 @@
     }
 
     /** 
-     * This method returns an object id instance corresponding to the Class 
-     * and String arguments. The String argument might have been the 
-     * result of executing toString on an object id instance. 
-     * @param pcClass the Class of the persistence-capable instance
-     * @param str the String form of the object id
+     * This method returns an object id instance corresponding to the pcClass
+     * and key arguments.
+     * @param pcClass the <code>Class</code> of the persistence-capable instance
+     * @param key the value of the key field for single-field identity.
      * @return an instance of the object identity class
      */
-    public Object newObjectIdInstance (Class pcClass, String str) {
+    public Object newObjectIdInstance (Class pcClass, Object key) {
         if (debugging())
-            debug("newObjectIdInstance for: " + pcClass + ", and " + str); // NOI18N
+            debug("newObjectIdInstance for: " + pcClass + ", and " + key); // NOI18N
 
         assertIsOpen();
-        return this.getStoreManager().newObjectIdInstance (pcClass, str);
+        return this.getStoreManager().newObjectIdInstance (pcClass, key);
     }
     
     /**

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=220183&r1=220182&r2=220183&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 13:53:28 2005
@@ -226,14 +226,13 @@
     public boolean hasActualPCClass(Object objectId);
 
     /** 
-     * This method returns an object id instance corresponding to the Class 
-     * and String arguments. The String argument might have been the 
-     * result of executing toString on an object id instance. 
-     * @param pcClass the Class of the persistence-capable instance
-     * @param str the String form of the object id
+     * This method returns an object id instance corresponding to the pcClass
+     * and key arguments.
+     * @param pcClass the <code>Class</code> of the persistence-capable instance
+     * @param key the value of the key field for single-field identity.
      * @return an instance of the object identity class
      */
-    public Object newObjectIdInstance (Class pcClass, String str);
+    public Object newObjectIdInstance (Class pcClass, Object key);
 
     /**
      * This method copies PK field values from internal Object Id into the