Hibernate - Não está inserindo no banco

Olá pessoal!
Estou estudando com a apostila que a Caelum disponibiliza (FJ 21) para download.
Estou tentando incluir um produto na tabela usando o Hibernate. No console mostra que foi realizado, mas quando faço uma consulta direto no banco, não retorna nada, a tabela está vazia.

hibernate.properties

hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost:3306/produtosteste
hibernate.connection.username = root
hibernate.connection.password = 402540

hibernate.show_sql = true
hibernate.format_sql = true

[quote=ToBack]Olá pessoal!
Estou estudando com a apostila que a Caelum disponibiliza (FJ 21) para download.
Estou tentando incluir um produto na tabela usando o Hibernate. No console mostra que foi realizado, mas quando faço uma consulta direto no banco, não retorna nada, a tabela está vazia.

hibernate.properties

hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost:3306/produtosteste
hibernate.connection.username = root
hibernate.connection.password = 402540

hibernate.show_sql = true
hibernate.format_sql = true

[/quote]

Posta o código pra gente?
:wink:

Classe produto

package hibernate;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.Columns;

@Entity
public class Produto implements Serializable{
	
	private long id;
	private String nome;	
	private String descricao;
	private double preco;	
	
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	
	public String getNome() {
		return nome;
	}
	
	public String getDescricao() {
		return descricao;
	}
	public double getPreco() {
		return preco;
	}	
	public void setId(long id) {
		this.id = id;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public void setDescricao(String descrcao) {
		this.descricao = descrcao;
	}
	public void setPreco(double preco) {
		this.preco = preco;
	}
	
	

}

Classe HibernateFactory

package hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateFactory {
	
	private static SessionFactory factory;
	
	static{
		AnnotationConfiguration cfg = new AnnotationConfiguration();
		cfg.addAnnotatedClass(Produto.class);
		factory = cfg.buildSessionFactory();
	}
	
	public Session getSession(){
		return factory.openSession();
	}

}

Adiciona o produto

package hibernate;

import org.hibernate.Session;

public class AdicionaProduto {
	
	public static void main(String[] args){
		
		Session session = new HibernateFactory().getSession();
		
		Produto p = new Produto();
		p.setNome("Banana");
		p.setDescricao("Banana Prata");
		p.setPreco(1.25);
		
		session.save(p);
		
		//System.out.println("ID produto: "+p.getId());
		
		session.close();
	}

}

Gera a tabela

package 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);
	}

}