hibernate自动导出数据库表

public static void main(String[] args) throws Exception{           //配置环境,分析xml映射文件
    Configuration conf= new Configuration().addClass(User.class);
    
    
//生成并输出sql到文件(当前目录)和数据库
    SchemaExport dbExport=new SchemaExport(conf);
    dbExport.create(
true, true);
}

posted @ 2010-06-11 15:39  栈长  阅读(125)  评论(0)    收藏  举报