ITeye博客

利用Hibernate导出生成数据库表

hlbng · 2009-05-26 11:20 · Hibernate · Markdown

import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

import junit.framework.TestCase;

public class CreateDB extends TestCase{

	public void testCreateDB(){
		Configuration cfg=new Configuration().configure("hibernate.cfg.xml");
		SchemaExport export=new SchemaExport(cfg);
		export.create(true, true);
	}
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。