This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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!!
Joined: Oct 17, 2012
Ok, it's easier after you take a closer look at the data.