I am using hibernate-release-4.2.4.Final version and tried using annotations instead of the hbm.xml file. But while running, it always throws an-annotation-configuration-instance-is-required-to-use-error.
When I tried importing org.hibernate.AnnotationConfiguration it showed the class was deprecated.
Then I tried copying Annotation configuration class file from the hibernate-annotation.jar and used and it in the hibernate3.jar and it worked fine.
My question is how to initialize a annotation configuration instance in the newer version of Hibernate release?
In Hibernate 4 you should not use
AnnotationConfigurationanymore, useConfigurationinstead.Use
HibernateUtilsor other session factory builder to build the session factory.An example of such utility you could find here.