HI. Im a newbie, and i just created a webapp with:
Hibernate Core 3.2.2.GA
certify that:
1) you have all the packages necessary
* From Hibernate EntityManager:
o hibernate-entitymanager.jar
o hibernate-annotations.jar
o jboss-archive-browsing.jar
o javassist.jar
* From Hibernate Core
o hibernate3.jar
o antlr-2.7.6.jar
o asm-attrs.jar
o asm.jar
o c3p0-0.9.0.jar
o cglib-2.1.3.jar
o commons-collections-2.1.1.jar
o commons-logging-1.0.4.jar
o concurrent-1.3.2.jar
o dom4j-1.6.1.jar
o ehcache-1.2.3.jar
o log4j-1.2.11.jar
You can find these libs on the respective lib directory on each project, wich you can download on the
www.hibernate.org site.
2) you have created on the root directory of the src files (outside of any package) a directory "META-INF" with the "persistence.xml" file with the configuration of the persistence-unit. Remember when you are creating the EntityManagerFactory with the follow line code, you have to use the same name of the specifyed on the persistence-unit tag of the persistence.xml file:
Code:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("persistence_unit_name");
for tests propose i advise you to create a hibernate tool so you can test if your annotations are well defined and well exported to the DB with the hbm2ddl tool.
Hope the tips were useful.
--ms