表的创建ExportDB

Posted on 2009-08-22 20:05  哥德巴赫猜  阅读(192)  评论(0)    收藏  举报
package com.bjsxt.hibernate;

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

public class ExportDB {

    public static void main(String[] args) {
        //读取hibernate.cfg.xml配置文件
        Configuration cfg = new Configuration().configure();
        //把对象类导成表
        SchemaExport export = new SchemaExport(cfg);
        //生成ddl
        export.create(true, true);

    }



}

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3