public class InitTable extends TestCase {
public static void main(String[] args){
Configuration conf = new Configuration().configure("hibernate.cfg.xml");
// //第一次运行时用来在数据库中创建表
// //并且把sql语句输出到txt文件用的
// //以后的运行不能使用该段代码,否则每次都会先删除原表,再新建该表
SchemaExport dbExport = new SchemaExport(conf);
dbExport.setOutputFile("D:/project_hd/iBridge/initSql.txt");
dbExport.create(true, true);
}
}
public static void main(String[] args){
Configuration conf = new Configuration().configure("hibernate.cfg.xml");
// //第一次运行时用来在数据库中创建表
// //并且把sql语句输出到txt文件用的
// //以后的运行不能使用该段代码,否则每次都会先删除原表,再新建该表
SchemaExport dbExport = new SchemaExport(conf);
dbExport.setOutputFile("D:/project_hd/iBridge/initSql.txt");
dbExport.create(true, true);
}
}