• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Annotations

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm trying to move my project to Annotations and I've downloaded the latest Hibernate distribution (3.6.0 final). I created a very simple annotated class and I'm trying to add it programmatically by doing this:



This is in the documentation of the release. But I'm getting a compiler (!!!) error: The method addAnnotatedClass(Class<Book>) is undefined for the type Configuration.

When I convert Configuration to AnnotationConfiguration I'm learning that it is deprecated and its functionality was moved to Configuration. So I'm running around in circles here. Just for good measure, here is my Book class:



And my HibernateUtil:



Any ideas? What am I doing wrong? What is the best way to add an annotated class programmatically, or otherwise?

Thanks!
Eddy
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think if you used the AnnotationConfiguration object, instead of the vanilla Configuration object, you'd be good.



(From This Tutorial)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic