junit执行成功,但没有在数据库中生成表
package com.entity; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.tool.hbm2ddl.SchemaExport; import org.junit.Test; public class TestStudents { @Test public void testSchemaExport() { // create cofig file Configuration config = new Configuration().configure(); SchemaExport export=new SchemaExport(config); export.create(true, true); } }
控制台输出:
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.