junit執(zhí)行成功,但沒有在數(shù)據(jù)庫(kù)中生成表
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); } }
控制臺(tái)輸出:
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.
2016-08-04
已經(jīng)找到原因了,連數(shù)據(jù)庫(kù)的URL寫錯(cuò)了
2016-08-04
hibertnate缺jboss-logging這個(gè)包