hibernate 中的hibernate.hbm2ddl.auto

来源:互联网 发布:阿里云备案域名转让 编辑:程序博客网 时间:2024/06/06 01:41
在hibernate中,如果在hibernate.cfg.xml文件中,将hibernate.hbm2ddl.auto设置为update(或者cretae-drop)也可以,如下
<property name="hibernate.hbm2ddl.auto">update</property>
则在运行应用程序时(第一次),会自动建立起表的结构(前提是先建立好数据库)。要注意的是,
当部署到服务器后,表结构是不会被马上建立起来的,是要等应用第一次运行起来后才会
原创粉丝点击