Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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