bom dia pessoal
espero que me ajudem
estou com um problema para fazer uma aplicação com hibernate anotation funciona, utilizo o mysql 5.1 tenho uma aplicação na qual ela roda normal com mapeamento xml mais quando mudo para o anotationn não funcionar aparece seguinte mensagem erro:
Exception in thread “main” org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
at org.hibernate.dialect.Dialect.instantiateDialect(Dialect.java:256)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:234)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:249)
at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:121)
at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:91)
at GeraTabelasAnotationn.main(GeraTabelasAnotationn.java:13)
estou usando um hibernate.cfg
<?xml version="1.0" encoding="UTF-8"?> org.hibernate.dialect.MySQLDialect com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/mecanica root 107senha true true</session-factory>
Classe que gerar as tabelas
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class GeraTabelasAnotationn
{
public static void main(String args[])
{
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Pessoa.class);
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
}
}
ta faltando alguma coisa? ou estou fazendo errado?
HELP