Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 127
  • Last Modified:

Java: Convert List<Object[]> to List<MyBean>

Hi Sirs
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.
0
Omer-Pitou
Asked:
Omer-Pitou
  • 2
1 Solution
 
CEHJCommented:
I wonder if there is not a tool that can do that
I suspect not, not least since one problem would be - how would the tool know how to convert from an array into a single object? How are you going to do that manually btw?
0
 
Omer-PitouAuthor Commented:
Thanks CEHJ,
Finally, I will build List<MyBean> manually, while looping through the resultSet.
0
 
CEHJCommented:
:)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now