Erro ao crira tabelas no Hibertnate

3 respostas
T

Estou seguindo um exemplo da aspostila da Caelum, sempre que tento criar a tabela vem esse erro.

hibernate.properties

hibernate.dialet = org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost/produtosTeste
hibernate.connection.username = root
hibernate.connection.password = 090898
Class
ackage hibernate;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class GerarTabelas {
	
	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);
	}

}
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.<init>(SchemaExport.java:121)
	at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
	at hibernate.GerarTabelas.main(GerarTabelas.java:12)

3 Respostas

RobsonFagundes

O Erro ja diz td …
faltou o dialect

MySql

postgre

Cada um tem o seu… add ele depois de

T+ Abraço

T

Obrigado pela ajuda! Com a sua ajuda acebei percebendo o erro:

hibernate.dialet = org.hibernate.dialect.MySQLDialect = errado

hibernate.dialect = org.hibernate.dialect.MySQLDialect = certo

Foi também falta de altenção minha. :lol:

RobsonFagundes

ooo Vlw Abraço

Criado 18 de fevereiro de 2009
Ultima resposta 18 de fev. de 2009
Respostas 3
Participantes 2