• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving result from a query with resultsetmapping using entity and columns

 
David Acevedo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am having some problems getting the information from a query that I did.
I specified a resultSetMapping like this:



In which I am putting the entity and an additional column that I bring in my sql query.

In my session bean I try to execute my query:



I can ensure that the information is stored in the list, I even can check the size of the list and it is correct, but I do not know
how to access the data. To which type of date can I cast the result of the query?.

I am pretty new working with resultSetMapping when combining entities with columns ... please somebody can help me out with
this problem. I have been trying and looking for examples in the forums, but I have not get anything useful.

Thanks in advance for your help.

BR
David

 
David Acevedo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved!



In the position 0 of the obj array is the Entity and in the second is the scalar value generated by the column.

I hope this will be useful for somebody

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic