• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

How to query?

 
Ranch Hand
Posts: 420
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 420
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did some google searching and found this. However, it seems to generate the same error. Is createQuery the preferred approach?

Thanks,
Siegfried
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException

=> ANTLR jar is missing
 
reply
    Bookmark Topic Watch Topic
  • New Topic