O meu hibernate.cfg.xml que está na pasta src ficou assim...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">8813</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/fj28</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<!-- entidades -->
<mapping class="br.com.caelum.goodbuy.modelo.Produto" />
</session-factory>
</hibernate-configuration>
Aqui eu rodo um método geratabela, igual ta no curso da caelum
public static void main(String[] args) {
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Produto.class);
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
}
e esse erro me é gerado quando executo o código acima..
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:305)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:283)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:298)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:121)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
at br.com.caelum.goodbuy.modelo.GeraTabelas.main(GeraTabelas.java:16)
