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);
        
        export.create(true, true);
    }
}


posted on 2012-04-06 10:18  海南一哥  阅读(134)  评论(0编辑  收藏  举报

导航