Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Get the error "hibernate dialect must be explicity set". Have the dialect property set in the hibernate.cfg.xml file as follows:
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
this same code works fine when annotations is not used, not sure what im doing wrong with annotations
Hibernate version:
3.1
Mapping documents:
none
Code between sessionFactory.openSession() and session.close():
static {
try {
sessionFactory = new AnnotationConfiguration()
.addAnnotatedClass(annot.Person.class)
.buildSessionFactory();
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
Full stack trace of any exception that occurs:
[java] Initial SessionFactory creation failed.org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at annot.HibernateUtil.<clinit>(Unknown Source)
[java] at annot.EventManager.createAndStorePerson(Unknown Source)
[java] at annot.EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
[java] at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
[java] at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
Name and version of the database you are using:
mysql 5.0.18
The generated SQL (show_sql=true):
none
Debug level Hibernate log excerpt: