arminw      2005/10/09 17:26:19

  Modified:    src/java/org/apache/ojb/broker/cache
                        CachingStrategyTwoLevelImpl.java
  Log:
  fix, put all values into object cache map
  
  Revision  Changes    Path
  1.6       +5 -5      
db-ojb/src/java/org/apache/ojb/broker/cache/CachingStrategyTwoLevelImpl.java
  
  Index: CachingStrategyTwoLevelImpl.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/CachingStrategyTwoLevelImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CachingStrategyTwoLevelImpl.java  7 Oct 2005 14:54:48 -0000       1.5
  +++ CachingStrategyTwoLevelImpl.java  10 Oct 2005 00:26:19 -0000      1.6
  @@ -138,8 +138,7 @@
               value = fld.getFieldConversion().javaToSql(value);
               // copy the sql type
               value = fld.getJdbcType().getFieldType().copy(value);
  -            // only need to cache non-null values
  -            if(value != null) target.put(fld.getPersistentField().getName(), 
value);
  +            target.put(fld.getPersistentField().getName(), value);
           }
           target.put(CLASS_NAME_STR, entry.getObject().getClass().getName());
           return new ObjectEntryImpl(target);
  @@ -165,7 +164,8 @@
           Object[]          fieldValues       = getFieldValues(source, 
nonCreationFields);
   
           // copy main object values
  -        for (int idx = 0; idx < fieldValues.length; idx++)
  +        int length = fieldValues.length;
  +        for (int idx = 0; idx < length; idx++)
           {
               nonCreationFields[idx].getPersistentField().set(target, 
fieldValues[idx]);
           }
  @@ -175,7 +175,7 @@
       /**
        * Extracts the java values for the given fields from the given map that 
contains
        * data retrieved from the database.
  -     * 
  +     *
        * @param source The map containing the values from the database
        * @param fields The fields
        * @return The values
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to