Olá galera
Estou seguindo a apostila da caelum fj21 e estou com o seguinte problema quando eu vou rodar a classe GeraTabela para gerar a tabela no banco
Tenho as seguintes classes
import java.util.Calendar;
import javax.persistence.*;
@Entity
public class Produto {
@Id
@GeneratedValue
Long id;
String nome;
double preco;
private Calendar dataInicioVenda;
getters and setters
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class GeraTabelas {
public static void main(String args[]){
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Produto.class);
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
}
}
arquivo hibernate.properties
hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jdbc:mysql://localhost/fj21
hibernate.connection.username = root
hibernate.connection.password = root
hibernate.show_sql = true
hibernate.format_sql = true
adicionei os .jar
hibernate3.jar
hibernate-testing.jar
antilr.jar
commons-collections.jar
dom4j.jar
javassist.jar
jta.jar
slfj4.jar
mysqlconnector.jar
E quando eu rodo a classe GeraTabela da o seguinte mensagem só que não cria a tabela no banco
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.5.0-Final
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.5.0-Final
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.username=root, hibernate.connection.password=****, hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.show_sql=true, hibernate.connection.url=jdbc:mysql://localhost/fj21, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.format_sql=true}
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Apr 6, 2010 2:10:15 PM org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.2.0.Final
Apr 6, 2010 2:10:15 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
Apr 6, 2010 2:10:15 PM org.hibernate.cfg.AnnotationConfiguration applyHibernateValidatorLegacyConstraintsOnDDL
INFO: Hibernate Validator not found: ignoring
Apr 6, 2010 2:10:15 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: Running hbm2ddl schema export
Apr 6, 2010 2:10:15 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: exporting generated schema to database
Apr 6, 2010 2:10:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Apr 6, 2010 2:10:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Apr 6, 2010 2:10:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
Apr 6, 2010 2:10:16 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/fj21
Apr 6, 2010 2:10:16 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=****}
Apr 6, 2010 2:10:16 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: schema export complete
Apr 6, 2010 2:10:16 PM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:mysql://localhost/fj21
Atenciosamente