Hibernate hbm2ddl.auto,可能的值,以及它们的功能 [英] Hibernate hbm2ddl.auto, possible values, and what they do

查看:140
本文介绍了Hibernate hbm2ddl.auto,可能的值,以及它们的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在查看Hibernate hbm2ddl.auto 配置属性及其可能的值:


  • 验证

  • 更新

  • create

  • create-drop



所有这些值是做什么的? Hibernate参考文档只会简要地谈及 create-drop ,但不会说其他任何值:


hibernate.hbm2ddl.auto



自动验证或将架构DDL导出到数据库时会创建 SessionFactory 。使用 create-drop ,当 SessionFactory 明确关闭时,数据库模式将被删除。



eg validate | 更新 | 创建 | create-drop


我发现非常有用这些堆栈溢出问题的解释:



但官方文档中仍然没有。

解决方案

您提供的链接已经是官方文档。所以,今天没有什么更正式和全面的。



所以我想你的问题的答案是双重的:





我知道这不是你梦寐以求的完美答案,但这实际上就是你今天所拥有的全部。



但好消息是,项目是开源的,所以你需要帮助完善它: - )。

I am looking at the Hibernate hbm2ddl.auto configuration property and its possible values:

  • validate
  • update
  • create
  • create-drop

What do all these values do?

The Hibernate Reference Documentation only talks briefly about create-drop, but doesn't say anything about the other values:

hibernate.hbm2ddl.auto

Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

e.g. validate | update | create | create-drop

I found very useful explanations in these Stack Overflow questions:

But still nothing in the official documentation.

解决方案

The link you provided is already the official documentation. So, there's nothing more official and comprehensive as-of today.

So I guess the answer to your question is two-fold:

I know this isn't the perfect answer you dreamt about, but this is actually all you have today.

But the good news is that the project is open-source, so you have all you need to help improve it :-).

这篇关于Hibernate hbm2ddl.auto,可能的值,以及它们的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆