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/otm/swizzle CopySwizzling.java
Date Thu, 21 Oct 2004 20:09:08 GMT
brj         2004/10/21 13:09:08

  Modified:    src/java/org/apache/ojb/otm/core ConcreteEditingContext.java
               src/java/org/apache/ojb/otm/swizzle CopySwizzling.java
  Log:
  use ProxyFactory
  
  Revision  Changes    Path
  1.50      +3 -15     db-ojb/src/java/org/apache/ojb/otm/core/ConcreteEditingContext.java
  
  Index: ConcreteEditingContext.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/otm/core/ConcreteEditingContext.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- ConcreteEditingContext.java	20 Oct 2004 18:50:46 -0000	1.49
  +++ ConcreteEditingContext.java	21 Oct 2004 20:09:08 -0000	1.50
  @@ -36,13 +36,11 @@
   import org.apache.ojb.broker.accesslayer.ConnectionManagerIF;
   import org.apache.ojb.broker.cache.ObjectCache;
   import org.apache.ojb.broker.core.proxy.CollectionProxy;
  -import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl;
   import org.apache.ojb.broker.core.proxy.CollectionProxyListener;
   import org.apache.ojb.broker.core.proxy.IndirectionHandler;
  -import org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl;
   import org.apache.ojb.broker.core.proxy.MaterializationListener;
  +import org.apache.ojb.broker.core.proxy.ProxyFactory;
   import org.apache.ojb.broker.core.proxy.ProxyHelper;
  -import org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.CollectionDescriptor;
   import org.apache.ojb.broker.metadata.FieldDescriptor;
  @@ -1164,18 +1162,8 @@
                   if (col instanceof CollectionProxy)
                   {
                       CollectionProxy cp = (CollectionProxy) col;
  -                    if (col instanceof List)
  -                    {
  -                        col = new ListProxyDefaultImpl(_pb.getPBKey(), cp.getCollectionClass(),
null);
  -                    }
  -                    else if (col instanceof Set)
  -                    {
  -                        col = new SetProxyDefaultImpl(_pb.getPBKey(), cp.getCollectionClass(),
null);
  -                    }
  -                    else
  -                    {
  -                        col = new CollectionProxyDefaultImpl(_pb.getPBKey(), cp.getCollectionClass(),
null);
  -                    }
  +                    
  +                    col = (Collection) ProxyFactory.createCollectionProxy(_pb.getPBKey(),
null, cp.getCollectionClass());
                       col.clear();
                   }
                   else
  
  
  
  1.12      +3 -12     db-ojb/src/java/org/apache/ojb/otm/swizzle/CopySwizzling.java
  
  Index: CopySwizzling.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/otm/swizzle/CopySwizzling.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CopySwizzling.java	20 Oct 2004 18:50:46 -0000	1.11
  +++ CopySwizzling.java	21 Oct 2004 20:09:08 -0000	1.12
  @@ -12,6 +12,7 @@
   import org.apache.ojb.broker.core.proxy.CollectionProxy;
   import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl;
   import org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl;
  +import org.apache.ojb.broker.core.proxy.ProxyFactory;
   import org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.CollectionDescriptor;
  @@ -128,18 +129,8 @@
                   if (newCol instanceof CollectionProxy)
                   {
                       CollectionProxy cp = (CollectionProxy) newCol;
  -                    if (newCol instanceof List)
  -                    {
  -                        oldCol = new ListProxyDefaultImpl(pb.getPBKey(), cp.getCollectionClass(),
cp.getQuery());
  -                    }
  -                    else if (newCol instanceof Set)
  -                    {
  -                        oldCol = new SetProxyDefaultImpl(pb.getPBKey(), cp.getCollectionClass(),
cp.getQuery());
  -                    }
  -                    else
  -                    {
  -                        oldCol = new CollectionProxyDefaultImpl(pb.getPBKey(), cp.getCollectionClass(),
cp.getQuery());
  -                    }
  +                    oldCol = (Collection) ProxyFactory.createCollectionProxy(pb.getPBKey(),
cp.getQuery(), cp.getCollectionClass());
  +
                       if (!((CollectionProxy) newCol).isLoaded())
                       {
                           field.set(oldObj, oldCol);
  
  
  

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