This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Retrieving data from Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Retrieving data from Hibernate" Watch "Retrieving data from Hibernate" New topic
Author

Retrieving data from Hibernate

Jesus Schneider
Greenhorn

Joined: Oct 17, 2012
Posts: 28
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

Joined: Oct 17, 2012
Posts: 28
Ok, it's easier after you take a closer look at the data.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving data from Hibernate
 
Similar Threads
SelectItems + IllegalArgumentException + help
JSF keeps displaying old values after Validation Phase fails (ignoring actionListeners settings)
Casting result of HQL query
selectOneMenu and custom converter
Question on dynamic dropdown list