[ 
https://issues.apache.org/jira/browse/DBUTILS-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17692013#comment-17692013
 ] 

Miguel Costa edited comment on DBUTILS-150 at 2/22/23 8:50 AM:
---------------------------------------------------------------

Sorry Indeed I could provide a an example of what cause this.
So this classes are generated of a proto that looks like this (basically any 
map or repeated "Message" will cause this):

{code:java}
syntax = "proto3";

package com.xyz.test;

message Test {
  map<string, SInt64Value> fldMap = 1;
  repeated SInt64Value anotherList = 2;
}

message SInt64Value  {
  sint64 intVal = 1;
}
{code}

It is stored as a BLOB in the DB.

This is the generated class from protoc [^TestCopy.java] 

So looking at it, the fields are of types com.google.protobuf.MapField and 
java.util.List
So maybe I'm wrong and the problem would be just for the MapField and not the 
java.util.List

Maybe the reason for this issue is that one could MapField to implement some 
sort of map, but it does not so maybe that's why it requires this special 
handling
https://protobuf.dev/reference/java/api-docs/com/google/protobuf/MapField






was (Author: miguel_costa):
Sorry Indeed I could provide a an example of what cause this.
So this classes are generated of a proto that looks like this (basically any 
map or repeated "Message" will cause this):

{code:java}
syntax = "proto3";

package com.xyz.test;

message Test {
  map<string, SInt64Value> fldMap = 1;
  repeated SInt64Value anotherList = 2;
}

message SInt64Value  {
  sint64 intVal = 1;
}
{code}

It is stored as a BLOB in the DB.

I'll copy/update the ticket with the generated class from protobuf in a little 
bit
 [^TestCopy.java] 

So looking at it, they are of type com.google.protobuf.MapField and 
java.util.List
So maybe I'm wrong and the problem would be just for the MapField and not the 
java.util.List

This because I would expect MapField to implement some sort of map, but it does 
not
https://protobuf.dev/reference/java/api-docs/com/google/protobuf/MapField





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

Reply via email to