[
https://issues.apache.org/jira/browse/DBUTILS-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17693504#comment-17693504
]
Carl Franklin Hall edited comment on DBUTILS-150 at 2/25/23 5:25 PM:
---------------------------------------------------------------------
After more testing, I believe the problem is between the code generated by
protobufs and JavaBeans.
I created the [^IndexedPropertyTestClass.java] to test. What I found was that
the {{IndexedPropertyDescriptor}} is never used because the field in the
ResultSet is the plural form ({{things}} vs {{thing}}; {{thing}} uses indexed
methods like {{getThing(idx)}}). From this, I believe the issue is not with the
handling of IndexedPropertyDescriptor but another bug I found along the way
with handling null read methods.
[~miguel_costa], in your property handler for BLOBs, do you handle it in an
indexed way (e.g., {{fldMap[key] = deserializedBlob[key]}}) or do you set the
whole reference at once (e.g., {{fldMap = deserializedBlob}})?
was (Author: thecarlhall):
After more testing, I believe the problem is between the code generated by
protobufs and JavaBeans.
I created the [^IndexedPropertyTestClass.java] to test. What I found was that
the {{IndexedPropertyDescriptor}} is never used because the field in the
ResultSet is the plural form ({{things}} vs {{thing}}; {{thing}} uses indexed
methods like {{getThing(idx)}}). From this, I believe the issue is not with the
handling of IndexedPropertyDescriptor but another bug I found along the way
with handling null read methods.
[~miguel_costa], in your property handler for BLOBs, do you handle it in an
indexed way (e.g., fldMap[key] = deserializedBlob[key]) or do you set the whole
reference at once (e.g., fldMap = deserializedBlob)?
> BeanProcessor populateBean does not work when PropertyDescriptor is of type
> ----------------------------------------------------------------------------
>
> Key: DBUTILS-150
> URL: https://issues.apache.org/jira/browse/DBUTILS-150
> Project: Commons DbUtils
> Issue Type: Improvement
> Affects Versions: 1.7
> Reporter: Miguel Costa
> Assignee: Carl Franklin Hall
> Priority: Major
> Fix For: 1.8
>
> Attachments: 2023-02-14 10_14_48-Window.png, 2023-02-14
> 10_17_28-Window.png, IndexedPropertyTestClass.java, TestCopy.java
>
>
> I've been using DB utils for a while to help me handle some custom beans
> (Protobufs)
> Anyway while debugging an issue I'm facing I noticed that the function
> BeanProcessor.populateBean is not able to handle
> PropertyDescriptor when their class is IndexedPropertyDescriptor instead of a
> normal PropertyDescriptor.
> IndexedPropertyDescriptor extends PropertyDescriptor so I would expect this
> to work without any issue, but currently it does not
>
> I can provide a PR for review with my best approach for it
--
This message was sent by Atlassian Jira
(v8.20.10#820010)