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 Thu, 06 May 2004 19:45:57 GMT
brj         2004/05/06 12:45:57

  Modified:    src/java/org/apache/ojb/broker/core
                        QueryReferenceBroker.java
               src/java/org/apache/ojb/broker/accesslayer
                        BasePrefetcher.java
  Log:
  recurse references before associating owners and children
  
  Revision  Changes    Path
  1.15      +10 -4     db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
  
  Index: QueryReferenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- QueryReferenceBroker.java	22 Apr 2004 16:16:08 -0000	1.14
  +++ QueryReferenceBroker.java	6 May 2004 19:45:57 -0000	1.15
  @@ -44,8 +44,8 @@
   import org.apache.ojb.broker.metadata.FieldDescriptor;
   import org.apache.ojb.broker.metadata.FieldHelper;
   import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
  -import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
   import org.apache.ojb.broker.metadata.fieldaccess.AnonymousPersistentField;
  +import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
  @@ -270,7 +270,12 @@
           return isFirst;
       }
   
  -    private void performRetrievalTasks()
  +    /**
  +     * Perform the stored retrieval tasks
  +     * BRJ: made it public to access it from BasePrefetcher
  +     * TODO: this is a quick fix !
  +     */
  +    public void performRetrievalTasks()
       {
           if (m_retrievalTasks == null)
           {
  @@ -337,7 +342,8 @@
               {
                   refObj = pb.doGetObjectByIdentity(id);
               }
  -            else if ((m_retrievalTasks != null) && !rds.isLazy()
  +            else if ((m_retrievalTasks != null) 
  +                    && !rds.isLazy()
                       && (rds.getItemProxyClass() == null))
               {
                   addRetrievalTask(obj, rds);
  
  
  
  1.8       +6 -1      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BasePrefetcher.java	4 Apr 2004 23:53:30 -0000	1.7
  +++ BasePrefetcher.java	6 May 2004 19:45:57 -0000	1.8
  @@ -23,6 +23,7 @@
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.core.PersistenceBrokerConfiguration;
  +import org.apache.ojb.broker.core.PersistenceBrokerImpl;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.DescriptorRepository;
   import org.apache.ojb.broker.metadata.FieldDescriptor;
  @@ -108,6 +109,10 @@
               }
           }
   
  +        // BRJ: performRetrieval of childrens references BEFORE associating with owners
  +        // TODO: this is a quick fix ! 
  +        ((PersistenceBrokerImpl)getBroker()).getReferenceBroker().performRetrievalTasks();
  +        
           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