This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes How to query? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to query?" Watch "How to query?" New topic
Author

How to query?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I'm working on making an example work using spring and hiberate as inspired by "Spring IN Action" 2nd ed page 189.

I have schema generation working and a call to essionFactory.getCurrentSession().saveOrUpdate(emp) working.

Now I would like to retrieve the one employee object I have successfully saved to MySQL.

The following does not work (see stack trace below) because it dies on the find function.

Questions:
(1) How do I fix the exception that is being thrown?
(2) I see that find is deprecated. How do I reimplement this with the new functions?
Thanks,
Siegfried

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I did some google searching and found this. However, it seems to generate the same error. Is createQuery the preferred approach?

Thanks,
Siegfried
Walter Bernstein
Ranch Hand

Joined: Dec 19, 2007
Posts: 57
Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException

=> ANTLR jar is missing
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to query?
 
Similar Threads
Problems with hibernate and mysql?
No Persistent Classes found for Query Class
Problem in pushing data through hibernate even after creating the hibernate session...
Newbie got stuck in Hibernate "Hello World"
data insert error