?? createdb.java
字號:
package com.oneedu.client;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class CreateDB {
public static void main(String[] args){
//讀取hibernate.cfg.xml文件。
//不調用.configure()時,默認讀取hibernate.properties配置文件
Configuration cfg = new Configuration().configure();
//一工具類, 生成hibernate.cfg.xml中定義的表。
SchemaExport export = new SchemaExport(cfg);
export.create(true,true); //如果第二個參數為true的話,會把原來的表刪除重建。
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -