不在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的第一个参数是是否打印建表语句,第二个参数是是否真的建表。
}

相关文章:

  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2021-12-16
  • 2021-11-23
  • 2021-11-22
  • 2021-04-27
猜你喜欢
  • 2022-02-17
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-05-30
  • 2021-08-09
相关资源
相似解决方案