Solved

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

Posted on 2016-08-24
3
44 Views
Last Modified: 2016-08-25
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
Comment
Question by:Omer-Pitou
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 41769889
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
 

Author Comment

by:Omer-Pitou
ID: 41770845
Thanks CEHJ,
Finally, I will build List<MyBean> manually, while looping through the resultSet.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41770969
:)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hash value 2 38
scoreUp challenge 14 48
How Complex Is This Java Course ? 9 63
Java Loop 4 20
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now