e ai rapaziada, blz…
** estou seguindo um tutorial da caelum sobre aplicação web…tenho alguns problemas ao usar o hibernate…uso o netbeans…
** tenho uma classe chamada GeraTabela:
package br.com.ricardo.hibernate;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class GeraTabela {
public static void main(String[] args) {
// Cria uma configuração para a classe produto
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Produto.class);
new SchemaExport(cfg).create(true,true);
}
}
** o meu hibernate.properties está no src da minha aplicação:
MySQL
hibernate.dialect = org.hibernate.dialect.MySQLDialect
#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost:3306/teste
hibernate.connection.username = root
hibernate.connection.password = catia
**** quando executa a classe GeraTabela , gera os seguintes erros…
Exception in thread "main" org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:610)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:632)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:84)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:59)
at br.com.ricardo.hibernate.GeraTabela.main(GeraTabela.java:12)
espero um help…
valeuu