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/core PersistenceBrokerImpl.java
Date Wed, 15 Oct 2003 15:41:10 GMT
brj         2003/10/15 08:41:10

  Modified:    src/java/org/apache/ojb/broker/core
                        PersistenceBrokerImpl.java
  Log:
  minor refactoring, renaming
  
  Revision  Changes    Path
  1.38      +10 -10    db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PersistenceBrokerImpl.java	1 Oct 2003 18:56:36 -0000	1.37
  +++ PersistenceBrokerImpl.java	15 Oct 2003 15:41:10 -0000	1.38
  @@ -1285,29 +1285,29 @@
       private Object getReferencedObject(Object obj, ObjectReferenceDescriptor rds, ClassDescriptor
cld)
       {
           Class referencedProxy;
  -        Object[] pkVals = rds.getForeignKeyValues(obj, cld);
  -        boolean allPkNull = true;
  +        Object[] fkValues = rds.getForeignKeyValues(obj, cld);
  +        boolean allFkValuesNull = true;
           Identity id;
   
  -        // BRJ: check if we have non null pk values
  +        // BRJ: check if we have non null fk values
           // TBD  we should also check primitives
           // to avoid creation of unmaterializable proxies
  -        for (int i = 0; i < pkVals.length; i++)
  +        for (int i = 0; i < fkValues.length; i++)
           {
  -            if (pkVals[i] != null)
  +            if (fkValues[i] != null)
               {
  -                allPkNull = false;
  +                allFkValuesNull = false;
                   break;
               }
           }
  -        // BRJ: if all pk values are null there's no referenced object
  -        if (allPkNull)
  +        // BRJ: if all fk values are null there's no referenced object
  +        if (allFkValuesNull)
           {
               return null;
           }
   
           // ensure that top-level extents are used for Identities
  -        id = new Identity(rds.getItemClass(), descriptorRepository.getTopLevelClass(rds.getItemClass()),
pkVals);
  +        id = new Identity(rds.getItemClass(), descriptorRepository.getTopLevelClass(rds.getItemClass()),
fkValues);
           //JMM : why not see if the object has already been loaded
           if ( objectCache.lookup(id) != null )
           {
  
  
  

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