db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer CollectionProxy.java
Date Sun, 02 Mar 2003 09:57:10 GMT
brj         2003/03/02 01:57:10

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        CollectionProxy.java
  Log:
  a cleared proxy will be treated as loaded. the data is not null
  
  Revision  Changes    Path
  1.14      +18 -3     db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionProxy.java
  
  Index: CollectionProxy.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionProxy.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CollectionProxy.java	24 Jan 2003 18:22:05 -0000	1.13
  +++ CollectionProxy.java	2 Mar 2003 09:57:10 -0000	1.14
  @@ -54,6 +54,7 @@
    * <http://www.apache.org/>.
    */
   
  +import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Iterator;
   
  @@ -252,12 +253,26 @@
   	}
   
   	/**
  +     * Clear the proxy. A cleared proxy is defined as loaded
  +     * 
   	 * @see Collection#clear()
   	 */
   	public void clear()
   	{
  -		setData(null);
  -		size = 0;
  +		Collection coll;
  +        
  +        // BRJ: use an empty collection so isLoaded will return true
  +		try
  +		{
  +			coll = (Collection) getCollectionClass().newInstance();
  +		}
  +		catch (Exception e)
  +		{
  +			coll = new ArrayList();
  +		}
  +        setData(coll);
  +        size = 0;
  +        
   	}
   
   	/**
  
  
  

Mime
View raw message