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 BasePrefetcher.java
Date Mon, 12 Jan 2004 19:43:57 GMT
brj         2004/01/12 11:43:57

  Modified:    src/java/org/apache/ojb/broker/accesslayer Tag:
                        OJB_BRANCH_1_0 BasePrefetcher.java
  Log:
  fixed ClassCastException when using collection class
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.3.2.1   +13 -7     db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java
  
  Index: BasePrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- BasePrefetcher.java	13 Dec 2003 11:59:02 -0000	1.3
  +++ BasePrefetcher.java	12 Jan 2004 19:43:57 -0000	1.3.2.1
  @@ -60,6 +60,7 @@
   
   
   import org.apache.ojb.broker.Identity;
  +import org.apache.ojb.broker.ManageableCollection;
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.core.PersistenceBrokerConfiguration;
  @@ -142,18 +143,23 @@
   
           for (int i = 0; i < queries.length; i++)
           {
  -            Collection newChildren;
  -
               if (collectionClass != null)
               {
  -                newChildren = (Collection) broker.getCollectionByQuery(collectionClass,
queries[i]);
  +                ManageableCollection newChildren = broker.getCollectionByQuery(collectionClass,
queries[i]);
  +                Iterator iter = newChildren.ojbIterator();
  +                
  +                while (iter.hasNext())
  +                {
  +                    children.add(iter.next()); 
  +                }
               }
               else
               {
  -                newChildren = broker.getCollectionByQuery(queries[i]);
  -            }
  -            children.addAll(newChildren);
  +                Collection newChildren = broker.getCollectionByQuery(queries[i]);
  +                children.addAll(newChildren);
  +            }           
           }
  +        
           associateBatched(owners, children);
       }
   
  
  
  

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


Mime
View raw message