Two Laptop Bag
The moose likes Object Relational Mapping and the fly likes Hibernate Annotations Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate Annotations " Watch "Hibernate Annotations " New topic
Author

Hibernate Annotations

Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
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 ]
 
 
subject: Hibernate Annotations
 
Threads others viewed
Hibernate Annotations
Problem using Annotations in hibernate
How to obtain configuration object?
Hibernate Dialect must be explicitly set
hbm file version working but annotation not
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture