Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving data from Hibernate

 
Jesus Schneider
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm programming a JSF+hibernate web application wit Netbeans 7.2.
I'm trying to populate a selectOneMenu with data from the database with this code:



The code above works fine (HQL and so on...) but there is a problem. The selectOneMenu gets populated with what seems SelectItems with the Object.toString(), not the CODE and DESCRIPTION.
I have debugged the data and it seems that the objects returned by the LIST are composed of 2 String (CODE, DESCRIPTION).
How can I do to transform the Object returned by the query.LIST into a SelectItem???

Thanks in advance!!
 
Jesus Schneider
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, it's easier after you take a closer look at the data.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic