db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/odmg/collections DListEntry.java DListImpl.java DMapEntry.java DMapImpl.java DSetImpl.java
Date Tue, 24 Dec 2002 13:32:45 GMT
arminw      2002/12/24 05:32:45

  Modified:    src/java/org/apache/ojb/odmg/collections DListEntry.java
                        DListImpl.java DMapEntry.java DMapImpl.java
                        DSetImpl.java
  Log:
  improve metadata handling:
  separate the object stuff (class descriptor, field descriptor, ...)
  from the connection stuff (jdbc descriptor).
  DescriptorRepository now handles only object
  specific properties.
  
  Do some performance improvements
  
  Revision  Changes    Path
  1.12      +2 -1      jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DListEntry.java
  
  Index: DListEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DListEntry.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DListEntry.java	20 Dec 2002 01:54:02 -0000	1.11
  +++ DListEntry.java	24 Dec 2002 13:32:45 -0000	1.12
  @@ -153,7 +153,8 @@
           try
           {
               PersistenceBroker broker = capsule.getBroker();
  -            int result = broker.getUniqueId(broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
  +            int result = broker.serviceSequenceManager().getUniqueId(
  +                    broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
               return result;
           }
           catch (Exception e)
  
  
  
  1.13      +8 -5      jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DListImpl.java
  
  Index: DListImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DListImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DListImpl.java	21 Dec 2002 17:35:53 -0000	1.12
  +++ DListImpl.java	24 Dec 2002 13:32:45 -0000	1.13
  @@ -65,11 +65,13 @@
   import org.apache.ojb.broker.PersistenceBrokerException;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.FieldDescriptor;
  +import org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldFactory;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  +import org.apache.ojb.broker.util.BrokerHelper;
   import org.apache.ojb.odmg.PBCapsule;
   import org.apache.ojb.odmg.TransactionImpl;
   import org.apache.ojb.odmg.TxManagerFactory;
  @@ -82,6 +84,7 @@
   import org.odmg.Transaction;
   import org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldFactory;
   
  +
   /**
    * Insert the type's description here.
    * Creation date: (10.02.2001 20:50:26)
  @@ -91,7 +94,7 @@
           ManageableCollection, java.io.Serializable
   {
       private Logger log = LoggerFactory.getLogger(DListImpl.class);
  -	/**
  +    /**
   	 * decide whether we can defer ID generation based on the type of persistentField we are
using
   	 * performance hit to generate these ID's is to much if you never use them.
   	 */
  @@ -111,7 +114,7 @@
           super();
           elements = new Vector();
           this.size = 0;
  -		if (!PersistentFieldFactory.usesAccessorsAndMutators())
  +        if (!PersistentFieldFactory.usesAccessorsAndMutators())
   			id = generateNewId();
       }
   
  @@ -124,7 +127,7 @@
           elements = new Vector();
           this.size = 0;
           this.pbKey = pbKey;
  -		if (!PersistentFieldFactory.usesAccessorsAndMutators())
  +        if (!PersistentFieldFactory.usesAccessorsAndMutators())
   			id = generateNewId();
       }
   
  @@ -288,7 +291,7 @@
           try
           {
               PersistenceBroker broker = capsule.getBroker();
  -            int result = broker.getUniqueId(broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
  +            int result = broker.serviceSequenceManager().getUniqueId(broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
               return result;
           }
           catch (Exception e)
  @@ -397,7 +400,7 @@
                   ClassDescriptor cld = brokerForClass.getClassDescriptor(obj.getClass());
   
                   FieldDescriptor[] pkFields = cld.getPkFields();
  -                Object[] pkValues = cld.getKeyValues(obj);
  +                Object[] pkValues = brokerForClass.serviceBrokerHelper().getKeyValues(cld,
obj);
   
                   Criteria criteria = new Criteria();
                   for (int j = 0; j < pkFields.length; j++)
  
  
  
  1.10      +3 -2      jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DMapEntry.java
  
  Index: DMapEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DMapEntry.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DMapEntry.java	20 Dec 2002 01:54:02 -0000	1.9
  +++ DMapEntry.java	24 Dec 2002 13:32:45 -0000	1.10
  @@ -133,7 +133,8 @@
           try
           {
               PersistenceBroker broker = capsule.getBroker();
  -            int result = broker.getUniqueId(broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
  +            int result = broker.serviceSequenceManager().getUniqueId(
  +                    broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
               return result;
           }
           catch (Exception e)
  
  
  
  1.13      +3 -2      jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DMapImpl.java
  
  Index: DMapImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DMapImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DMapImpl.java	21 Dec 2002 17:35:53 -0000	1.12
  +++ DMapImpl.java	24 Dec 2002 13:32:45 -0000	1.13
  @@ -151,7 +151,8 @@
           try
           {
               PersistenceBroker broker = capsule.getBroker();
  -            int result = broker.getUniqueId(broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
  +            int result = broker.serviceSequenceManager().getUniqueId(
  +                    broker.getClassDescriptor(this.getClass()).getAutoIncrementField());
               return result;
           }
           catch (Exception e)
  
  
  
  1.12      +3 -2      jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DSetImpl.java
  
  Index: DSetImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/collections/DSetImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DSetImpl.java	21 Dec 2002 17:35:53 -0000	1.11
  +++ DSetImpl.java	24 Dec 2002 13:32:45 -0000	1.12
  @@ -68,6 +68,7 @@
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  +import org.apache.ojb.broker.util.BrokerHelper;
   import org.apache.ojb.odmg.PBCapsule;
   import org.apache.ojb.odmg.TransactionImpl;
   import org.apache.ojb.odmg.TxManagerFactory;
  @@ -202,7 +203,7 @@
           {
           	ClassDescriptor cld = capsule.getBroker().getClassDescriptor(this.getClass());
           	FieldDescriptor fld = cld.getFieldDescriptorByName("id");
  -            int result = capsule.getBroker().getUniqueId(fld);
  +            int result = capsule.getBroker().serviceSequenceManager().getUniqueId(fld);
               return result;
           }
           catch (Exception e)
  @@ -355,7 +356,7 @@
                   ClassDescriptor cld = broker.getClassDescriptor(obj.getClass());
   
                   FieldDescriptor[] pkFields = cld.getPkFields();
  -                Object[] pkValues = cld.getKeyValues(obj);
  +                Object[] pkValues = broker.serviceBrokerHelper().getKeyValues(cld, obj);
   
                   Criteria criteria = new Criteria();
                   for (int j = 0; j < pkFields.length; j++)
  
  
  

Mime
View raw message