Hibernate hbm2ddl.auto,可能的价值观和他们做什么 - 任何官方的解释? [英] Hibernate hbm2ddl.auto, possible values and what they do - any official explanation?

查看:139
本文介绍了Hibernate hbm2ddl.auto,可能的价值观和他们做什么 - 任何官方的解释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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


  • 验证

  • 更新

  • 创建

  • create-drop

  • validate
  • update
  • create
  • create-drop

是否有关于所有这些值做什么的官方,完整说明?

Is there an official, full explanation about what all these values do?

Hibernate参考文档仅简要介绍 create-drop ,但不会说关于其他值的任何内容:

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


hibernate.hbm2ddl.auto

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

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.

例如 验证 更新 | 创建 | create-drop

我发现非常有用这些SO问题的解释:

I found very useful explanations in these SO questions:

  • Hibernate hbm2ddl.auto possible values and what they do?
  • Schema is not dropped on hbmddl.auto = create.drop

但在官方文档中仍然没有。任何指针?

But still nothing in the official documentation. Any pointers?

推荐答案

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

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:

  • either file an enhancement request in the Hibernate issue tracker (better with a proposal)
  • or read the corresponding code

我知道这不是你梦寐以求的完美答案,但这其实是今天所有的。

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天全站免登陆