cstmgl commented on PR #180:
URL: https://github.com/apache/commons-dbutils/pull/180#issuecomment-1429375093

   > Hi, @cstmgl ! Would you please tell me more about what you're seeing that 
brought you to this change? Could you share any exceptions, error messages, or 
oddities you've seen? On first scan of the code and the API doc you shared, I 
don't understand what effect this PR has. I'm keying particularly on this 
statement from the javadoc,
   > 
   > > If a property is indexed, then its entry in the result array belongs to 
the 
[IndexedPropertyDescriptor](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/beans/IndexedPropertyDescriptor.html)
 subclass of the 
[PropertyDescriptor](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/beans/PropertyDescriptor.html)
 class
   > 
   > From this and the submitted code change, the caller outside of this method 
would still need to cast the property descriptor to 
`IndexedPropertyDescriptor`. This leaves me confused to what the suggested 
change does downstream.
   
   I'll try to explain the best I can and sorry if the details are confusing, I 
wanted to share also some debug print screens but I can't seem to be able to do 
it.
   If anything I'll try to update the ticket.
   
   So the experience I found was:
   
   - I have a couple of LOBs (BLOBs) in the database and when I try to load 
them to my Bean those fields were always null (not all but the ones that are 
IndexedPropertyDescriptor
   - I could not understand why initially but then I noticed that it was 
because the result was never fetch because "processColumn" was never called
   - with some debugs I found out that the propType was actually null so the 
process column was skipped
   ```
         if (propType != null) {
           value = this.processColumn(rs, i, propType);
   
           if (value == null && propType.isPrimitive()) {
             value = primitiveDefaults.get(propType);
           }
         }
   ```
   - the reason for why it would be null was a bit un-expected but it really 
seems that while IndexedPropertyDescriptor is an extension of 
PropertyDescriptor by some reason the getPropertyType() always returns null and 
it expects to be called getIndexedPropertyType() I don't know why
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to