db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r220153 - in /incubator/jdo/trunk/runtime20: ./ src/java/org/apache/jdo/impl/pm/ src/java/org/apache/jdo/impl/state/
Date Thu, 21 Jul 2005 18:05:07 GMT
Author: mbo
Date: Thu Jul 21 11:05:00 2005
New Revision: 220153

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

Modified:
    incubator/jdo/trunk/runtime20/project.xml
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/StateManagerImpl.java

Modified: incubator/jdo/trunk/runtime20/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/project.xml?rev=220153&r1=220152&r2=220153&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/project.xml (original)
+++ incubator/jdo/trunk/runtime20/project.xml Thu Jul 21 11:05:00 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/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=220153&r1=220152&r2=220153&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 11:05:00 2005
@@ -32,6 +32,8 @@
 import java.util.Properties;
 
 import javax.jdo.Extent;
+import javax.jdo.FetchPlan;
+import javax.jdo.JDOException;
 import javax.jdo.JDOFatalInternalException;
 import javax.jdo.JDOFatalUserException;
 import javax.jdo.JDOUserException;
@@ -39,6 +41,9 @@
 import javax.jdo.PersistenceManagerFactory;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
+import javax.jdo.datastore.JDOConnection;
+import javax.jdo.datastore.Sequence;
+import javax.jdo.listener.InstanceLifecycleListener;
 import javax.jdo.spi.PersistenceCapable;
 import javax.transaction.Status;
 
@@ -368,6 +373,29 @@
 
         return _txCache.getObjectById(oid, validate);
     }
+    /**
+     * Looks up the instance of the given type with the given key.
+     * @param cls The type of object to load
+     * @param key either the string representation of the object id, or
+     * an object representation of a single field identity key
+     * @return the corresponding persistent instance
+     * @since 2.0
+     */
+    public Object getObjectById (Class cls, Object key) {
+        throw new UnsupportedOperationException(
+            "Method getObjectById(Class,Object) not yet implemented");
+    }
+
+    /**
+     * Looks up the instance corresponding to the specified oid. This is
+     * equivalent to <code>getObjectById(oid, true);
+     * @param oid The object id of the object to load
+     * @return the corresponding persistent instance
+     * @since 2.0
+     */
+    public Object getObjectById (Object oid) {
+        return getObjectById(oid, true);
+    }
 
     /** The ObjectId returned by this method represents the JDO identity of
     * the instance.  The ObjectId is a copy (clone) of the internal state
@@ -515,6 +543,64 @@
         return this.getStoreManager().newObjectIdInstance (pcClass, str);
     }
     
+    /**
+     * Return the objects with the given oids.
+     * @param oids the oids of the objects to return
+     * @param validate if true, the existance of the objects in
+     *     the datastore will be validated.
+     * @return the objects that were looked up, in the
+     *     same order as the oids parameter.
+     * @see #getObjectById(Object,boolean)
+     * @since 2.0
+     */
+    public Collection getObjectsById (Collection oids, boolean validate) {
+        throw new UnsupportedOperationException(
+            "Method getObjectsById(Collection,boolean) not yet implemented");
+    }
+
+    /**
+     * Return the objects with the given oids. This method is equivalent 
+     * to calling {@link #getObjectsById(Collection, boolean)}
+     * with the validate flag true.
+     * @param oids the oids of the objects to return
+     * @return the objects that were looked up, in the
+     *     same order as the oids parameter.
+     * @see #getObjectsById(Collection,boolean)
+     * @since 2.0
+     */
+    public Collection getObjectsById (Collection oids) {
+        return getObjectsById(oids, true);
+    }
+
+    /**
+     * Return the objects with the given oids.
+     * @param oids the oids of the objects to return
+     * @param validate if true, the existance of the objects in
+     *     the datastore will be validated.
+     * @return the objects that were looked up, in the
+     *     same order as the oids parameter.
+     * @see #getObjectById(Object,boolean)
+     * @since 2.0
+     */
+    public Object[] getObjectsById (Object[] oids, boolean validate) {
+        throw new UnsupportedOperationException(
+            "Method getObjectsById(Object[],boolean) not yet implemented");
+    }
+
+    /**
+     * Return the objects with the given oids. This method is equivalent
+     * to calling {@link #getObjectsById(Object[],boolean)} 
+     * with the validate flag true.
+     * @param oids the oids of the objects to return
+     * @return the objects that were looked up, in the
+     *     same order as the oids parameter.
+     * @see #getObjectsById(Object[],boolean)
+     * @since 2.0
+     */
+    public Object[] getObjectsById (Object[] oids) {
+        return getObjectsById(oids, true);
+    }
+
     /** Return the Class that implements the JDO Identity for the
     * specified PersistenceCapable Class.  The application can use the
     * returned Class to construct a JDO Identity instance for
@@ -554,6 +640,14 @@
      */  
      public abstract Query newQuery (Object 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 abstract Query newQuery (String query);
+
      /** 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
@@ -603,6 +697,17 @@
       * @param filter the Filter for candidate instances */  
      public abstract Query newQuery(Extent cln, String 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>
+     * @since 2.0
+     */
+    public abstract Query newNamedQuery (Class cls, String queryName);
+
     /** The PersistenceManager may manage a collection of instances in the data
      * store based on the class of the instances.  This method returns an
      * Extent of instances in the data store that might be iterated or
@@ -633,6 +738,16 @@
         return rc;
     }
 
+    /**
+     * Equivalent to <code>getExtent (persistenceCapableClass,
+     * true)</code>.
+     * @see #getExtent(Class,boolean)
+     * @since 2.0
+     */
+    public Extent getExtent (Class persistenceCapableClass) {
+        return getExtent(persistenceCapableClass, true);
+    }
+
     class EmptyExtent implements Extent {
         private final Class cls;
         private final boolean subclasses;
@@ -654,6 +769,10 @@
         }
         public void closeAll() { }
         public void close(Iterator it) { }
+        public FetchPlan getFetchPlan() {
+            throw new UnsupportedOperationException(
+                "Method getFetchPlan not yet implemented");
+        }
     }
 
     //
@@ -1004,6 +1123,16 @@
         }
     }
 
+    /**
+     * Refreshes all instances in the exception that failed verification.
+     *
+     * @since 2.0
+     */
+    public void refreshAll(JDOException jdoe) {
+        throw new UnsupportedOperationException(
+            "Method refreshAll(JDOException) not yet implemented");
+    }
+
     /** Retrieve field values of an instance from the store.  This tells
      * the <code>PersistenceManager</code> that the application intends to use
the
      * instance, and its field values must be retrieved.
@@ -1117,6 +1246,263 @@
         return _userObject;
     }
      
+    /**
+     * Detach the specified object from the <code>PersistenceManager</code>.
+     * @param pc the instance to detach
+     * @return the detached instance
+     * @see #detachCopyAll(Object[])
+     * @since 2.0
+     */
+    public Object detachCopy (Object pc) {
+        throw new UnsupportedOperationException(
+            "Method detachCopy(Object) not yet implemented");
+    }
+
+    /**
+     * Detach the specified objects from the <code>PersistenceManager</code>.
+     * @param pcs the instances to detach
+     * @return the detached instances
+     * @see #detachCopyAll(Object[])
+     * @since 2.0
+     */
+    public Collection detachCopyAll (Collection pcs) {
+        throw new UnsupportedOperationException(
+            "Method detachCopy(Collection) not yet implemented");
+    }
+
+    /**
+     * Detach the specified objects from the
+     * <code>PersistenceManager</code>. The objects returned can be
+     * manipulated and re-attached with 
+     * {@link #attachCopyAll(Object[], boolean)}. 
+     * The detached instances will be
+     * unmanaged copies of the specified parameters, and are suitable
+     * for serialization and manipulation outside of a JDO
+     * environment. When detaching instances, only fields in the
+     * current {@link FetchPlan} will be traversed. Thus, to detach a
+     * graph of objects, relations to other persistent instances must
+     * either be in the <code>default-fetch-group</code>, or in the
+     * current custom {@link FetchPlan}.
+     * @param pcs the instances to detach
+     * @return the detached instances
+     * @throws JDOUserException if any of the instances do not
+     * @see #attachCopyAll(Object[], boolean)
+     * @see #getFetchPlan
+     * @since 2.0
+     */
+    public Object[] detachCopyAll (Object [] pcs) {
+        throw new UnsupportedOperationException(
+            "Method detachCopy(Object[]) not yet implemented");
+    }
+
+    /**
+     * Import the specified object into the
+     * <code>PersistenceManager</code>.
+     * @param pc instance to import
+     * @param makeTransactional if <code>true</code>, this method will
+     *     mark transactional the persistent instances corresponding
+     *     to all instances in the closure of the detached graph.
+     * @return the re-attached instance
+     * @see #attachCopyAll(Object[],boolean)
+     * @since		2.0
+     */
+    public Object attachCopy (Object pc, boolean makeTransactional) {
+        throw new UnsupportedOperationException(
+            "Method attachCopy(Object,boolean) not yet implemented");
+    }
+
+    /**
+     * Import the specified objects into the
+     * <code>PersistenceManager</code>.
+     * @param pcs Collection of instances to import
+     * @param makeTransactional if <code>true</code>, this method will
+     *     mark transactional the persistent instances corresponding
+     *     to all instances in the closure of the detached graph.
+     * @return the re-attached instances
+     * @see #attachCopyAll(Object[],boolean)
+     * @since 2.0
+     */
+    public Collection attachCopyAll (Collection pcs, boolean makeTransactional) {
+        throw new UnsupportedOperationException(
+            "Method attachCopyAll(Collection,boolean) not yet implemented");
+    }
+
+    /**
+     * Import the specified objects into the
+     * <code>PersistenceManager</code>. Instances that were
+     * previously detached from this or another
+     * <code>PersistenceManager</code> will have their changed merged
+     * into the persistent instances. Instances that are new will be
+     * persisted as new instances.
+     * @param pcs array of instances to import
+     * @param makeTransactional	if <code>true</code>, this method will
+     *     mark transactional the persistent instances corresponding
+     *     to all instances in the closure of the detached graph.
+     * @return the re-attached instances
+     * @see #detachCopyAll(Object[])
+     * @since 2.0
+     */
+    public Object[] attachCopyAll (Object[] pcs, boolean makeTransactional) {
+        throw new UnsupportedOperationException(
+            "Method attachCopyAll(Object[],boolean) not yet implemented");
+    }
+
+    /**
+     * Put the specified key-value pair into the map of user objects.
+     * @since 2.0
+     */
+    public Object putUserObject (Object key, Object val) {
+        throw new UnsupportedOperationException(
+            "Method putUserObject(Object,Object) not yet implemented");
+    }
+
+    /**
+     * Get the value for the specified key from the map of user objects.
+     * @param key the key of the object to be returned
+     * @return the object 
+     * @since 2.0
+     */
+    public Object getUserObject (Object key) {
+        throw new UnsupportedOperationException(
+            "Method getUserObject(Object) not yet implemented");
+    }
+
+    /**
+     * Remove the specified key and its value from the map of user objects.
+     * @param key the key of the object to be removed
+     * @since 2.0
+     */
+    public Object removeUserObject (Object key) {
+        throw new UnsupportedOperationException(
+            "Method removeUserObject(Object) not yet implemented");
+    }
+
+    /**
+     * Flushes all dirty, new, and deleted instances to the data
+     * store. It has no effect if a transaction is not active.
+     * <p>If a datastore transaction is active, this method
+     * synchronizes the cache with the datastore and reports any
+     * exceptions.</p>
+     * <p>If an optimistic transaction is active, this method obtains
+     * a datastore connection, synchronizes the cache with the
+     * datastore using this connection and reports any
+     * exceptions. The connection obtained by this method is held
+     * until the end of the transaction.</p>
+     * <p>If exceptions occur during flush, the implementation will
+     * set the current transaction's <code>RollbackOnly</code> flag
+     * (see {@link Transaction#setRollbackOnly}).</p>
+     * @since	2.0
+     */
+    public synchronized void flush () {
+        if (debugging())
+            debug("flush"); // NOI18N
+
+        _transaction.internalFlush();
+    }
+
+    /**
+     * Validates the <code>PersistenceManager</code> cache with the
+     * datastore. This method has no effect if a transaction is not
+     * active.
+     * <p>If a datastore transaction is active, this method verifies
+     * the consistency of instances in the cache against the
+     * datastore. An implementation might flush instances as if
+     * {@link #flush} were called, but it is not required to do
+     * so.</p>
+     * <p>If an optimistic transaction is active, this method obtains
+     * a datastore connection and verifies the consistency of the
+     * instances in the cache against the datastore. If any
+     * inconsistencies are detected, a {@link
+     * JDOOptimisticVerificationException} is thrown. This exception
+     * contains a nested {@link JDOOptimisticVerificationException}
+     * for each object that failed the consistency check. No
+     * datastore resources acquired during the execution of this
+     * method are held beyond the scope of this method.</p>
+     * @since 2.0
+     */
+    public void checkConsistency () {
+        throw new UnsupportedOperationException(
+            "Method checkConsistency() not yet implemented");
+    }
+
+    /**
+     * Returns the <code>FetchPlan</code> used by this
+     * <code>PersistenceManager</code>.
+     * @return the FetchPlan
+     * @since 2.0
+     */
+    public FetchPlan getFetchPlan () {
+        throw new UnsupportedOperationException(
+            "Method getFetchPlan() not yet implemented");
+    }
+
+    /**
+     * Creates an instance of a persistence-capable interface or
+     * abstract class. The returned instance is transient.
+     * @param pcClass Must be an abstract class or interface 
+     *     that is declared in the metadata.
+     * @return the created instance
+     * @since 2.0
+     */
+    public Object newInstance (Class pcClass) {
+        throw new UnsupportedOperationException(
+            "Method newInstance(Class) not yet implemented");
+    }
+
+    /**
+     * Returns the sequence identified by <code>name</code>.
+     * @param name the name of the Sequence
+     * @return the Sequence
+     * @since 2.0
+     */
+    public Sequence getSequence (String name) {
+        throw new UnsupportedOperationException(
+            "Method getSequence(String) not yet implemented");
+    }
+
+    /**
+     * If this method is called while a datastore transaction is
+     * active, the object returned will be enlisted in the current
+     * transaction. If called in an optimistic transaction or outside
+     * an active transaction, the object returned will not be
+     * enlisted in any transaction.
+     * @return the JDOConnection instance
+     * @since 2.0
+     */
+    public JDOConnection getDataStoreConnection () {
+        throw new UnsupportedOperationException(
+            "Method getDataStoreConnection() not yet implemented");
+    };
+
+    /**
+     * Adds the listener instance to the list of lifecycle event
+     * listeners. 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
+     * <code>listenerInstance</code>.
+     * <p>The listenerInstance will be called for each event for which it
+     * implements the corresponding listenerInstance 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) not yet implemented");
+    };
+
+    /**
+     * Removes the listener instance from the list of lifecycle event listeners.
+     * @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");
+    }
+
     /** The JDO vendor might store certain non-operational properties and
     * make those properties available to applications (for troubleshooting).
     *   
@@ -1689,20 +2075,6 @@
              (status == Status.STATUS_MARKED_ROLLBACK));
         _txCache.afterCompletion(abort);
         _flushing = false;
-    }
-
-    /**
-     * Called by Query or Extent to flush updates to the database
-     * in a datastore transaction. Delegates to TransactionImpl to do
-     * the processing that will call internaly flushInstances() to do actual
-     * flush.
-     * @see #flushInstances()
-     */
-    public synchronized void flush() {
-        if (debugging())
-            debug("flush"); // NOI18N
-
-        _transaction.internalFlush();
     }
 
     /**

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java?rev=220153&r1=220152&r2=220153&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
(original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
Thu Jul 21 11:05:00 2005
@@ -25,6 +25,9 @@
 import java.util.*;
 
 import javax.jdo.*;
+import javax.jdo.datastore.JDOConnection;
+import javax.jdo.datastore.Sequence;
+import javax.jdo.listener.InstanceLifecycleListener;
 
 import org.apache.jdo.pm.PersistenceManagerInternal;
 import org.apache.jdo.util.I18NHelper;
@@ -244,6 +247,18 @@
         }
     }
 
+    /**
+     * @see javax.jdo.PersistenceManager#refreshAll(JDOException jdoe)
+     */
+    public  void refreshAll(JDOException jdoe) {
+        if (isValid) {
+            pm.refreshAll(jdoe);
+        } else {
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        }
+    }
+
     /** 
      * @see javax.jdo.PersistenceManager#newQuery()
      */
@@ -254,7 +269,8 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
+
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Object compiled)
      */
@@ -265,9 +281,21 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
+     * @see javax.jdo.PersistenceManager#newQuery(String query)
+     */
+    public Query newQuery(String query){
+        if (isValid) { 
+            return pm.newQuery(query);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
      * @see javax.jdo.PersistenceManager#newQuery(Class cls)
      */
     public Query newQuery(Class cls){
@@ -277,7 +305,7 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Extent cln)
@@ -289,7 +317,7 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Class cls,Collection cln)
@@ -313,7 +341,7 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Class cls, String filter)
@@ -325,7 +353,7 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Class cls, Collection cln, String filter)
@@ -337,7 +365,7 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#newQuery(Extent cln, String filter)
@@ -349,7 +377,19 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#newNamedQuery(Class cls, String queryName)
+     */
+    public Query newNamedQuery(Class cls, String queryName) {
+        if (isValid) { 
+            return pm.newNamedQuery(cls, queryName);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#getExtent(Class persistenceCapableClass,
@@ -362,7 +402,19 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getExtent(Class persistenceCapableClass)
+     */
+    public Extent getExtent(Class persistenceCapableClass){
+        if (isValid) { 
+            return pm.getExtent(persistenceCapableClass);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
 
     /** 
      * @see javax.jdo.PersistenceManager#getObjectById(Object oid, boolean validate)
@@ -374,7 +426,31 @@
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getObjectById(Class cls, Object key)
+     */
+    public Object getObjectById(Class cls, Object key){
+        if (isValid) { 
+            return pm.getObjectById(cls, key);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getObjectById(Object oid)
+     */
+    public Object getObjectById(Object oid){
+        if (isValid) { 
+            return pm.getObjectById(oid);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
     
     /** 
      * @see javax.jdo.PersistenceManager#getObjectId(Object pc)
@@ -401,18 +477,66 @@
    }
     
     /** 
-     * @see javax.jdo.PersistenceManager#newObjectIdInstance (Class pcClass, String str)
+     * @see javax.jdo.PersistenceManager#newObjectIdInstance (Class pcClass, Object key)
      */
-    public Object newObjectIdInstance (Class pcClass, String str) {
+    public Object newObjectIdInstance (Class pcClass, Object key) {
         if (isValid) { 
-            return pm.newObjectIdInstance (pcClass, str);
+            return pm.newObjectIdInstance (pcClass, key);
         } else { 
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N
         } 
-   }
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getObjectsById (Collection oids, boolean validate)
+     */
+    public Collection getObjectsById (Collection oids, boolean validate) {
+        if (isValid) { 
+            return pm.getObjectsById (oids, validate);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
     
     /** 
+     * @see javax.jdo.PersistenceManager#getObjectsById (Collection oids)
+     */
+    public Collection getObjectsById (Collection oids) {
+        if (isValid) { 
+            return pm.getObjectsById (oids);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getObjectsById (Object[] oids, boolean validate)
+     */
+    public Object[] getObjectsById (Object[] oids, boolean validate) {
+        if (isValid) { 
+            return pm.getObjectsById (oids, validate);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getObjectsById (Object[] oids)
+     */
+    public Object[] getObjectsById (Object[] oids) {
+        if (isValid) { 
+            return pm.getObjectsById (oids);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
      * @see javax.jdo.PersistenceManager#makePersistent(Object pc)
      */
     public void makePersistent(Object pc){
@@ -722,6 +846,214 @@
     public Class getObjectIdClass(Class cls){
         if (isValid) { 
             return pm.getObjectIdClass(cls);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#detachCopy (Object pc)
+     */
+    public Object detachCopy (Object pc) {
+        if (isValid) { 
+            return pm.detachCopy(pc);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#detachCopyAll (Collection pcs)
+     */
+    public Collection detachCopyAll (Collection pcs) {
+        if (isValid) { 
+            return pm.detachCopyAll(pcs);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#detachCopyAll (Object [] pcs)
+     */
+    public Object[] detachCopyAll (Object [] pcs) {
+        if (isValid) { 
+            return pm.detachCopyAll(pcs);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#attachCopy (Object pc, boolean makeTransactional)
+     */
+    public Object attachCopy (Object pc, boolean makeTransactional) {
+        if (isValid) { 
+            return pm.attachCopy(pc, makeTransactional);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#attachCopyAll (Collection pcs, boolean makeTransactional)
+     */
+    public Collection attachCopyAll (Collection pcs, boolean makeTransactional) {
+        if (isValid) { 
+            return pm.attachCopyAll(pcs, makeTransactional);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#attachCopyAll (Object[] pcs, boolean makeTransactional)
+     */
+    public Object[] attachCopyAll (Object[] pcs, boolean makeTransactional) {
+        if (isValid) { 
+            return pm.attachCopyAll(pcs, makeTransactional);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#putUserObject (Object key, Object val)
+     */
+    public Object putUserObject (Object key, Object val) {
+        if (isValid) { 
+            return pm.putUserObject(key, val);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getUserObject (Object key)
+     */
+    public Object getUserObject (Object key) {
+        if (isValid) { 
+            return pm.getUserObject(key);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#removeUserObject (Object key)
+     */
+    public Object removeUserObject (Object key) {
+        if (isValid) { 
+            return pm.removeUserObject(key);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#flush ()
+     */
+    public void flush () {
+        if (isValid) { 
+            pm.flush();
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#checkConsistency ()
+     */
+    public void checkConsistency () {
+        if (isValid) { 
+            pm.checkConsistency();
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getFetchPlan ()
+     */
+    public FetchPlan getFetchPlan () {
+        if (isValid) { 
+            return pm.getFetchPlan();
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#newInstance (Class pcClass)
+     */
+    public Object newInstance (Class pcClass) {
+        if (isValid) { 
+            return pm.newInstance(pcClass);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getSequence (String name)
+     */
+    public Sequence getSequence (String name) {
+        if (isValid) { 
+            return pm.getSequence(name);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#getDataStoreConnection ()
+     */
+    public JDOConnection getDataStoreConnection () {
+        if (isValid) { 
+            return pm.getDataStoreConnection();
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#addInstanceLifecycleListener (
+     * InstanceLifecycleListener listener, Class[] classes)
+     */
+    public void addInstanceLifecycleListener (
+        InstanceLifecycleListener listener, Class[] classes) {
+        if (isValid) { 
+            pm.addInstanceLifecycleListener(listener, classes);
+        } else { 
+            throw new JDOFatalUserException(msg.msg(
+                "EXC_PersistenceManagerClosed"));// NOI18N
+        } 
+    }
+
+    /** 
+     * @see javax.jdo.PersistenceManager#removeInstanceLifecycleListener (
+     * InstanceLifecycleListener listener)
+     */
+    public void removeInstanceLifecycleListener (
+        InstanceLifecycleListener listener) {
+        if (isValid) { 
+            pm.removeInstanceLifecycleListener(listener);
         } else { 
             throw new JDOFatalUserException(msg.msg(
                 "EXC_PersistenceManagerClosed"));// NOI18N

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java?rev=220153&r1=220152&r2=220153&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java (original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java Thu
Jul 21 11:05:00 2005
@@ -498,13 +498,25 @@
         }
     }
 
-    //
-    // ----- Other public methods ------
-    //
+    /**
+     * Returns the rollback-only status of the transaction. When
+     * begun, the rollback-only status is false. Either the 
+     * application or the JDO implementation may set this flag
+     * using setRollbackOnly.
+     * @return <code>true</code> if the transaction has been
+     * marked for rollback.
+     * @since 2.0
+     */
+    public boolean getRollbackOnly() {
+        throw new UnsupportedOperationException(
+            "Method getRollbackOnly not yet implemented");
+    }
 
     /**
-     * Modify the transaction object such that the only possible outcome of
-     * the transaction is to roll back.
+     * Sets the rollback-only status of the transaction to <code>true</code>.
+     * After this flag is set to <code>true</code>, the transaction 
+     * can no longer be committed, and any attempt to commit the 
+     * transaction will throw <code>JDOUserException<code>.
      */
     public void setRollbackOnly() {
         if (debugging())
@@ -530,6 +542,10 @@
         }
 
     }
+
+    //
+    // ----- Other public methods ------
+    //
 
     /**
      * Obtain the status of this transaction object.

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=220153&r1=220152&r2=220153&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 11:05:00 2005
@@ -1720,6 +1720,16 @@
         return getTransactionalObjectId();
     }
 
+    /** Return the object representing the version 
+     * of the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @return the object representing the version of the calling instance
+     * @since 2.0
+     */    
+    public Object getVersion (PersistenceCapable pc) {
+        throw new UnsupportedOperationException(
+            "Method getVersion(PersistenceCapable) not yet implemented");
+    }
 
     /** Tests whether this object is dirty.
      *   
@@ -2300,6 +2310,70 @@
     public Object replacingObjectField(PersistenceCapable pc, int field) {
         loadingField(pc, field);
         return fieldManager.fetchObjectField(field);
+    }
+
+    /** The replacing value of the object id in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param oid the current value of the oid
+     * @return the new value for the oid
+     * @since 2.0
+     */
+    public Object replacingObjectId (PersistenceCapable pc, Object oid) {
+        throw new UnsupportedOperationException(
+            "Method replacingObjectId(PersistenceCapable, Object) not yet implemented");
+    }
+
+    /** The replacing value of the version in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param version the current value of the version
+     * @return the new value for the version
+     * @since 2.0
+     */
+    public Object replacingVersion (PersistenceCapable pc, Object version) {
+        throw new UnsupportedOperationException(
+            "Method replacingVersion(PersistenceCapable, Object) not yet implemented");
+    }
+
+    /** The provided value of the loaded field list in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param loaded the current value of the loaded field list
+     * @since 2.0
+     */
+    public void providedLoadedFieldList (PersistenceCapable pc, BitSet loaded) {
+        throw new UnsupportedOperationException(
+            "Method providedLoadedFieldList(PersistenceCapable, BitSet) not yet implemented");
+    }
+
+    /** The replacing value of the loaded field list in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param loaded the current value of the loaded field list
+     * @return the replacement value for the loaded field list
+     * @since 2.0
+     */
+    public BitSet replacingLoadedFieldList (PersistenceCapable pc, BitSet loaded) {
+        throw new UnsupportedOperationException(
+            "Method replacingLoadedFieldList(PersistenceCapable, BitSet) not yet implemented");
+    }
+
+    /** The provided value of the modified field list in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param modified the current value of the modified field list
+     * @since 2.0
+     */
+    public void providedModifiedFieldList (PersistenceCapable pc, BitSet modified) {
+        throw new UnsupportedOperationException(
+            "Method providedModifiedFieldList(PersistenceCapable, BitSet) not yet implemented");
+    }
+
+    /** The replacing value of the modified field list in the calling instance.
+     * @param pc the calling <code>PersistenceCapable</code> instance
+     * @param modified the current value of the modified field list
+     * @return the replacement value for the modified field list
+     * @since 2.0
+     */
+    public BitSet replacingModifiedFieldList (PersistenceCapable pc, BitSet modified) {
+        throw new UnsupportedOperationException(
+            "Method replacingModifiedFieldList(PersistenceCapable, BitSet) not yet implemented");
     }
 
     //



Mime
View raw message