SchemaExport

不在xml中配置

        <!-- Drop and re-create the database schema on startup
        <property name="hbm2ddl.auto">update</property>
         -->

也可以在程序中生成建表语句。

 

public void testSchemaExport() {
    new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);//create的第一个参数是是否打印建表语句,第二个参数是是否真的建表。
}

posted @ 2013-12-16 14:08  剑握在手  阅读(282)  评论(0编辑  收藏  举报
返回顶部↑