Ao executar a minha rotina para criar as tabelas no banco aparece o seguinte erro no console:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Segue a classe a qual executo para criação e o hibernate config:
[code]
public class GerarTabelas {
public static void main(String[] args) {
Configuration cfg = new AnnotationConfiguration();
cfg.configure();
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
}
}[/code]
Hibernate:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Configuração Banco do Banco -->
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">123456</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/teste</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.hbm2ddl.auto">commit</property>
<property name="connection.pool_size">2</property>
<!-- configuration pool via c3p0 -->
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property> <!-- seconds -->
<!-- DEPRECATED very expensive property name="c3p0.validate> -->
<!-- Entidades -->
<mapping class="ws.futuranet.modelo.Usuario" />
<mapping class="ws.futuranet.modelo.Dispositivo" />
<mapping class="ws.futuranet.modelo.Cliente" />
<mapping class="ws.futuranet.modelo.Grupo" />
<mapping class="ws.futuranet.modelo.GrupoEntrevistador" />
</session-factory>
</hibernate-configuration>