You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by br...@apache.org on 2004/05/03 02:12:02 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/jdo PersistenceManagerImpl.java QueryImpl.java TransactionImpl.java

brianm      2004/05/02 17:12:02

  Modified:    src/java/org/apache/ojb/jdo PersistenceManagerImpl.java
                        QueryImpl.java TransactionImpl.java
  Log:
  Filled in some more optional methods (most with JdoUnsupportedOperationException) until we can get them implemented
  
  Revision  Changes    Path
  1.12      +15 -7     db-ojb/src/java/org/apache/ojb/jdo/PersistenceManagerImpl.java
  
  Index: PersistenceManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/jdo/PersistenceManagerImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PersistenceManagerImpl.java	14 Apr 2004 13:12:04 -0000	1.11
  +++ PersistenceManagerImpl.java	3 May 2004 00:12:02 -0000	1.12
  @@ -17,6 +17,8 @@
   import org.apache.ojb.broker.Identity;
   import org.apache.ojb.broker.PBKey;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
  +import org.apache.ojb.broker.core.proxy.ProxyHelper;
  +import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl;
   import org.apache.ojb.jdo.spi.StateManagerImpl;
   import org.apache.ojb.otm.EditingContext;
   import org.apache.ojb.otm.OTMConnection;
  @@ -696,8 +698,8 @@
       }
   
       /**
  +     * Force materialization of real object
        * @param o
  -     * @todo What does this do?
        */
       public void retrieve(Object o)
       {
  @@ -705,12 +707,12 @@
           {
               throw new JDOFatalUserException(generateIsClosedErrorMessage("retrieve(Object)"));
           }
  -        throw new UnsupportedOperationException("Not yet implemented!");
  +        ProxyHelper.getRealObject(o);
       }
   
       /**
  +     * Force materialization of all items in collection
        * @param collection
  -     * @todo What does this do?
        */
       public void retrieveAll(Collection collection)
       {
  @@ -722,7 +724,13 @@
           {
               throw new NullPointerException("retrieveAll(Collection) was passed a null Collection.");
           }
  -        throw new UnsupportedOperationException("Not yet implemented!");
  +
  +        /* @todo I consider this a hack as CPDI is configurable now! */
  +        if (collection instanceof CollectionProxyDefaultImpl)
  +        {
  +            CollectionProxyDefaultImpl cp = (CollectionProxyDefaultImpl) collection;
  +            cp.getData();
  +        }
       }
   
       public void retrieveAll(Object[] objects)
  @@ -735,7 +743,7 @@
           {
               throw new NullPointerException("retrieveAll(Object[]) was passed a null Array.");
           }
  -        throw new UnsupportedOperationException("Not yet implemented!");
  +        // We don't proxy arrays
       }
   
       public void setUserObject(Object o)
  @@ -766,7 +774,7 @@
       }
   
       /**
  -     * @todo what does this do?
  +     * @todo This will need to change when we have a JDO compliant Identity implementation
        */
       public Class getObjectIdClass(Class aClass)
       {
  @@ -774,7 +782,7 @@
           {
               throw new JDOFatalUserException(generateIsClosedErrorMessage("getObjectIdClass(Class)"));
           }
  -        throw new UnsupportedOperationException("Not yet implemented!");
  +        return Identity.class;
       }
   
       public void setMultithreaded(boolean b)
  
  
  
  1.8       +6 -3      db-ojb/src/java/org/apache/ojb/jdo/QueryImpl.java
  
  Index: QueryImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/jdo/QueryImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- QueryImpl.java	14 Apr 2004 13:12:04 -0000	1.7
  +++ QueryImpl.java	3 May 2004 00:12:02 -0000	1.8
  @@ -153,7 +153,7 @@
   	}
   
       /**
  -     * @todo verify correctness of all the Strings
  +     * @todo verify correctness of all the Strings is required here
        */
   	public void compile()
   	{
  @@ -169,10 +169,13 @@
           else return results;
   	}
   
  +    /**
  +     * @todo implement
  +     */
   	public Object execute(Object o)
   	{
  -		throw new UnsupportedOperationException("Not yet implemented!");
  -	}
  +        throw new UnsupportedOperationException("Not yet implemented!");
  +  	}
   
   	public Object execute(Object o, Object o1)
   	{
  
  
  
  1.7       +29 -2     db-ojb/src/java/org/apache/ojb/jdo/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/jdo/TransactionImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TransactionImpl.java	14 Apr 2004 13:12:04 -0000	1.6
  +++ TransactionImpl.java	3 May 2004 00:12:02 -0000	1.7
  @@ -21,6 +21,7 @@
   import javax.jdo.Transaction;
   import javax.jdo.PersistenceManager;
   import javax.jdo.JDOUserException;
  +import javax.jdo.JDOUnsupportedOptionException;
   import javax.transaction.Synchronization;
   
   /**
  @@ -93,40 +94,66 @@
   		return false;
   	}
   
  +    /**
  +     * @todo figure out what to do if someone doesn't want this!
  +     */
   	public void setRetainValues(boolean b)
   	{
  +        // umh, this is always true.
   	}
   
   	public boolean getRetainValues()
   	{
  -		return false;
  +		return true;
   	}
   
  +    /**
  +     * @todo implement
  +     */
   	public void setRestoreValues(boolean b)
   	{
  +        throw new JDOUnsupportedOptionException("Not Yet Implemented");
   	}
   
  +    /**
  +     * @todo implement
  +     */
   	public boolean getRestoreValues()
   	{
   		return false;
   	}
   
  +    /**
  +     * @todo implement
  +     */
   	public void setOptimistic(boolean b)
   	{
  +        throw new JDOUnsupportedOptionException("Not yet implemented");
   	}
   
  +    /**
  +     * @todo implement
  +     */
   	public boolean getOptimistic()
   	{
   		return false;
   	}
   
  +    /**
  +     * @todo figure out how to implement
  +     * @param synchronization
  +     */
   	public void setSynchronization(Synchronization synchronization)
   	{
  +        throw new JDOUnsupportedOptionException("Not Yet Implemented");
   	}
   
  +    /**
  +     * @todo figure out how to implement
  +     */
   	public Synchronization getSynchronization()
   	{
  -		return null;
  +		throw new JDOUnsupportedOptionException("Not Yet Implemented");
   	}
   
   	public PersistenceManager getPersistenceManager()
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org