【发布时间】:2013-08-07 06:59:36
【问题描述】:
我正在查看 Hibernate hbm2ddl.auto 配置属性及其可能的值:
validateupdatecreatecreate-drop
所有这些值有什么作用?
Hibernate Reference Documentation 只简单介绍了create-drop,而没有提及其他值:
hibernate.hbm2ddl.auto在创建
SessionFactory时自动验证架构 DDL 或将其导出到数据库。使用create-drop,当SessionFactory显式关闭时,数据库架构将被删除。例如
validate|update|create|create-drop
我在这些 Stack Overflow 问题中发现非常有用的解释:
- Hibernate hbm2ddl.auto possible values and what they do?
- Schema is not dropped on hbmddl.auto = create.drop
但官方文档中仍然没有。
【问题讨论】:
-
查看这个问题的答案:stackoverflow.com/questions/438146/…
-
实际上,我链接到了这个问题。我在 Hibernate 文档中寻找 the 官方解释。
标签: hibernate orm properties hbm2ddl