db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r371087 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
Date Sat, 21 Jan 2006 17:18:00 GMT
Author: arminw
Date: Sat Jan 21 09:17:55 2006
New Revision: 371087

URL: http://svn.apache.org/viewcvs?rev=371087&view=rev
Log:
minor improvement

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java?rev=371087&r1=371086&r2=371087&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
Sat Jan 21 09:17:55 2006
@@ -49,7 +49,7 @@
  * RsIterator can be used to iterate over a jdbc ResultSet to retrieve
  * persistent objects step-by-step and not all at once. In fact the
  * PersistenceBroker::getCollectionByQuery(...) method uses a RsIterator
- * internally to build up a Collection of objects
+ * internally to build up a Collection of objects.
  *
  * <p>
  * NOTE: OJB is very strict in handling <tt>RsIterator</tt> instances. <tt>RsIterator</tt>
is
@@ -421,7 +421,9 @@
      */
     protected Object getObjectFromResultSet() throws PersistenceBrokerException
     {
-        getRow().clear();
+        Map row = getRow();
+        PersistenceBrokerInternal pb = getBroker();
+        row.clear();
         /**
          * MBAIRD if a proxy is to be used, return a proxy instance and dont
          * perfom a full materialization. NOTE: Potential problem here with
@@ -435,7 +437,7 @@
         RowReader rowReader = getQueryObject().getClassDescriptor().getRowReader();
         // in any case we need the PK values of result set row
         // provide m_row with primary key data of current row
-        rowReader.readPkValuesFrom(getRsAndStmt(), getRow());
+        rowReader.readPkValuesFrom(getRsAndStmt(), row);
 
         if (getItemProxyClass() != null)
         {
@@ -454,10 +456,10 @@
             {
 
                 // map all field values from the current result set
-                rowReader.readObjectArrayFrom(getRsAndStmt(), getRow());
+                rowReader.readObjectArrayFrom(getRsAndStmt(), row);
                 // 3. If Object is not in cache
                 // materialize Object with primitive attributes filled from current row
-                result = rowReader.readObjectFrom(getRow());
+                result = rowReader.readObjectFrom(row);
                 // result may still be null!
                 if (result != null)
                 {
@@ -480,12 +482,12 @@
                              * actual class.
                              */
                             // fill reference and collection attributes
-                            ClassDescriptor cld = getBroker().getClassDescriptor(result.getClass());
+                            ClassDescriptor cld = pb.getClassDescriptor(result.getClass());
                             // don't force loading of reference
                             final boolean unforced = false;
                             // Maps ReferenceDescriptors to HashSets of owners
-                            getBroker().getReferenceBroker().retrieveReferences(result, cld,
unforced);
-                            getBroker().getReferenceBroker().retrieveCollections(result,
cld, unforced);
+                            pb.getReferenceBroker().retrieveReferences(result, cld, unforced);
+                            pb.getReferenceBroker().retrieveCollections(result, cld, unforced);
                             getCache().disableMaterializationCache();
                         }
                         catch(RuntimeException e)
@@ -499,16 +501,16 @@
             }
             else // Object is in cache
             {
-                ClassDescriptor cld = getBroker().getClassDescriptor(result.getClass());
+                ClassDescriptor cld = pb.getClassDescriptor(result.getClass());
                 // if refresh is required, read all values from the result set and
                 // update the cache instance from the db
                 if (cld.isAlwaysRefresh())
                 {
                     // map all field values from the current result set
-                    rowReader.readObjectArrayFrom(getRsAndStmt(), getRow());
-                    rowReader.refreshObject(result, getRow());
+                    rowReader.readObjectArrayFrom(getRsAndStmt(), row);
+                    rowReader.refreshObject(result, row);
                 }
-                getBroker().checkRefreshRelationships(result, oid, cld);
+                pb.checkRefreshRelationships(result, oid, cld);
             }
 
             return result;



---------------------------------------------------------------------
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