Hello,
Using
Hibernate 3.3.1 GA
Hibernate Annotations 3.4.0 GA
JEE 5
JSE 1.6
Eclipse 3.4.1
MySQL 5.0
I am trying to learn Hibernate using annotations. I have managed to get it working not using annotations but when I am converting to annotations things does not work that smooth anymore.
I have tried putting the connection properties in both hibernate.properties XOR hibernate.cfg.xml with no improvements. I found this link wich can be a hint (that can help someone wiser than me...):
http://wyding.blogspot.com/2009/03/why-you-got-hibernate-dialect-must-be.html And yes, I am using Eclipse Ganymede.
hibernate.properties:
hibernate.cfg.xml
In my HibernateUtil class i changed
sessionFactory=new Configuration().configure().buildSessionFactory()
to
sessionFactory = new AnnotationConfiguration().buildSessionFactory()
I have seen in some instructions that
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory()
is used instead, but then I get the error:
/hibernate.cfg.xml not found
instead.
When searching for this problem there are a lot of people having the same problem but I cannot find any answers... And if there are any answers on hibernates own forum it's impossible to find out now since the site has been unavailable for a few days already...
Any help would be most apreciated, about to get a bit (just a little...eh) frustrated.
Thank you in advance!
Regards,
Niklas