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 ReferencePrefetcher.java
Date Wed, 15 Oct 2003 17:04:18 GMT
brj         2003/10/15 10:04:18

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ReferencePrefetcher.java
  Log:
  prevent loading referenced object if fk is null
  
  Revision  Changes    Path
  1.12      +10 -3     db-ojb/src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java
  
  Index: ReferencePrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ReferencePrefetcher.java	20 Sep 2003 18:58:46 -0000	1.11
  +++ ReferencePrefetcher.java	15 Oct 2003 17:04:18 -0000	1.12
  @@ -109,8 +109,15 @@
           {
               owner = iter.next();
               fkValues = ord.getForeignKeyValues(owner,cld);
  -            id = new Identity(null, topLevelClass, fkValues);
  -            relatedObject = pb.getObjectByIdentity(id);
  +            if (!isNull(fkValues))
  +            {
  +                id = new Identity(null, topLevelClass, fkValues);
  +                relatedObject = pb.getObjectByIdentity(id);                
  +            }
  +            else
  +            {
  +                relatedObject = null;
  +            }
               field.set(owner, relatedObject);
           }
       }
  
  
  

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