Pessoal, configurei tudo certinho no habernate e no eclipse.
Quando rodo o método para gerar tabelas, ele me da as segintes linhas e não gera as tabelas:
0 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.3.1.GA
16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
31 [main] INFO org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.postgresql.Driver, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.format_sql=true, hibernate.query.substitutions=yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=postgres, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:postgresql://localhost/allware, hibernate.show_sql=true, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
31 [main] INFO org.hibernate.cfg.Environment - using java.io streams to persist binary types
31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
31 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
156 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.PostgreSQLDialect
281 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
281 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - schema export complete
## PostgreSQL
hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/allware
hibernate.connection.username postgres
hibernate.connection.password postgre
Minha Classe que gera as tabelas
package br.com.allware.testes.geral;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import br.com.allware.classes.modelos.Produto;
public class Teste {
public static void main(String[] args) {
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Produto.class);
new SchemaExport(cfg).create(true, false);
}
}
Minha Classe de Produtos
package br.com.allware.classes.modelos;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.annotations.Entity;
@Entity
public class Produto {
@Id
@GeneratedValue
private int codigo;
private String nome;
private Double preco;
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Double getPreco() {
return preco;
}
public void setPreco(Double preco) {
this.preco = preco;
}
}
Me ajudem por favor.
PW2