db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer CollectionPrefetcher.java
Date Sun, 03 Apr 2005 02:22:39 GMT
arminw      2005/04/02 18:22:39

  Modified:    src/java/org/apache/ojb/broker/accesslayer Tag:
                        OJB_1_0_RELEASE CollectionPrefetcher.java
  Log:
  use IdentityFactory to create Identity objects
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.29.2.1  +6 -4      db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java
  
  Index: CollectionPrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -r1.29 -r1.29.2.1
  --- CollectionPrefetcher.java	11 Jun 2004 18:49:09 -0000	1.29
  +++ CollectionPrefetcher.java	3 Apr 2005 02:22:39 -0000	1.29.2.1
  @@ -27,6 +27,7 @@
   import org.apache.ojb.broker.ManageableCollection;
   import org.apache.ojb.broker.OJBRuntimeException;
   import org.apache.ojb.broker.PersistenceBroker;
  +import org.apache.ojb.broker.IdentityFactory;
   import org.apache.ojb.broker.core.PersistenceBrokerImpl;
   import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl;
   import org.apache.ojb.broker.core.proxy.ProxyHelper;
  @@ -133,11 +134,12 @@
           Class collectionClass = cds.getCollectionClass(); // this collection type will
be used:
           HashMap ownerIdsToLists = new HashMap(owners.size());
   
  +        IdentityFactory identityFactory = pb.serviceIdentity();
           // initialize the owner list map
           for (Iterator it = owners.iterator(); it.hasNext();)
           {
               Object owner = it.next();
  -            ownerIdsToLists.put(new Identity(owner, pb), new ArrayList());
  +            ownerIdsToLists.put(identityFactory.buildIdentity(getOwnerClassDescriptor(),
owner), new ArrayList());
           }
   
           // build the children lists for the owners
  @@ -148,7 +150,7 @@
               ClassDescriptor cld = getDescriptorRepository().getDescriptorFor(ProxyHelper.getRealClass(child));
   
               Object[] fkValues = cds.getForeignKeyValues(child, cld);
  -            Identity ownerId = new Identity(null, ownerTopLevelClass, fkValues);
  +            Identity ownerId = identityFactory.buildIdentity(null, ownerTopLevelClass,
fkValues);
               List list = (List) ownerIdsToLists.get(ownerId);
               if (list != null)
               {
  @@ -161,7 +163,7 @@
           {
               Object result;
               Object owner = it.next();
  -            Identity ownerId = new Identity(owner, pb);
  +            Identity ownerId = identityFactory.buildIdentity(owner);
               List list = (List) ownerIdsToLists.get(ownerId);
   
               if ((collectionClass == null) && field.getType().isArray())
  
  
  

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