This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Annotations

Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • 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.

[ May 15, 2007: Message edited by: Reema Patel ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic