• 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: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I've made a simple "Hello World" app with Hibernate Annotations.
I'm struck at getting a SessionFactory. Ive tried bothe the code fragments.

Approach 1 -


Here, I get a runtime error saying:

[java] at hello.HelloWorld.main(Unknown Source)
[java] Caused by: org.hibernate.MappingException: An AnnotationConfiguratio
n instance is required to use <mapping class="hello.Message"/>


Approach 2 -


Here I get compilation error saying that AnnotationConfiguration class not found. Whereas I've included the following packages:
import org.hibernate.*;
import org.hibernate.cfg.*;
import javax.persistence.*;

Any help shall be highly appreciated.

Thanks,
Reema
[ May 15, 2007: Message edited by: Reema Patel ]
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic