Java: Convert List<Object> to List<MyBean>
Posted on 2016-08-24
I have a List<Object> that I want to convert to a List<MyBean>, and pass it to JRBeanCollectionDatasoure.
I have options: Looping through the list and Building List<MyBean>, or define an Entity class pointing to a working table.
I wonder if there is not a tool that can do that, similar to what JackSon does with its convertValue, readValue voids, etc...
The SELECT statement based on which I build List<Object> comes from a stored procedure handling all my reports requests. So the fields in that SELECT are similar to those in MyBean.
Any idea will be welcome.