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/metadata ClassDescriptor.java
Date Sun, 25 Sep 2005 01:55:44 GMT
arminw      2005/09/24 18:55:44

  Modified:    src/java/org/apache/ojb/broker/metadata ClassDescriptor.java
  Log:
  fix bug: copy super-reference fields in CachingStrategy too, allow including of inherited
fields in non creation argument fields method
  fix bug: exclude database managed locking fields from read-write fields method
  
  Revision  Changes    Path
  1.111     +14 -7     db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java
  
  Index: ClassDescriptor.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- ClassDescriptor.java	3 Sep 2005 15:28:14 -0000	1.110
  +++ ClassDescriptor.java	25 Sep 2005 01:55:44 -0000	1.111
  @@ -981,16 +981,18 @@
       /**
        * Returns the fields that are not used as arguments for creating instances for this
        * class descriptor.
  -     * 
  +     *
  +     * @param withInherited If 'true' all inherited fields will be included
  +     * (when mapping classes on multiple joined tables).
        * @return The fields
        */
  -    public FieldDescriptor[] getNonCreationArgumentFields()
  +    public FieldDescriptor[] getNonCreationArgumentFields(boolean withInherited)
       {
           if (getCreationDescriptor().hasFieldParameters())
           {
               ListOrderedSet result = new ListOrderedSet();
   
  -            result.addAll(Arrays.asList(getFieldDescriptions()));
  +            result.addAll(Arrays.asList(getFieldDescriptor(withInherited)));
               for (Iterator it = getCreationDescriptor().getParameters().iterator(); it.hasNext();)
               {
                   CreationParameter param = (CreationParameter)it.next();
  @@ -1004,7 +1006,7 @@
           }
           else
           {
  -            return getFieldDescriptions();
  +            return getFieldDescriptor(withInherited);
           }
       }
   
  @@ -1045,10 +1047,15 @@
               for (int i = 0; i < fields.length; i++)
               {
                   FieldDescriptor fd = fields[i];
  -                if (!fd.isAccessReadOnly())
  +                /*
  +                arminw: if locking is enabled and the increment of locking
  +                values is done by the database, the field is read-only
  +                */
  +                if(fd.isAccessReadOnly() || (fd.isLocking() && !fd.isUpdateLock()))
                   {
  -                    rwFields.add(fd);
  +                    continue;
                   }
  +                rwFields.add(fd);
               }
               m_RwFieldDescriptors =
                   (FieldDescriptor[]) rwFields.toArray(new FieldDescriptor[rwFields.size()]);
  
  
  

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