測試Hierbnate之前,需要建立表格
package com.houlu.SH_DRP.util;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
/**
* 將hbm導出生成ddl
* @author Administrator
*
*/
public class ExportDB {
public static void main(String[] args) {
//默認讀取hibernate.cfg.xml文件
Configuration cfg = new Configuration().configure();
SchemaExport export = new SchemaExport(cfg);
export.create(true, true);
}
}