What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do

前端 未结 13 2472
轮回少年
轮回少年 2020-11-21 04:47

I really want to know more about the update, export and the values that could be given to hibernate.hbm2ddl.auto
I need to know when to use the update and w

13条回答
  •  再見小時候
    2020-11-21 05:37

    The configuration property is called hibernate.hbm2ddl.auto

    In our development environment we set hibernate.hbm2ddl.auto=create-drop to drop and create a clean database each time we deploy, so that our database is in a known state.

    In theory, you can set hibernate.hbm2ddl.auto=update to update your database with changes to your model, but I would not trust that on a production database. An earlier version of the documentation said that this was experimental, at least; I do not know the current status.

    Therefore, for our production database, do not set hibernate.hbm2ddl.auto - the default is to make no database changes. Instead, we manually create an SQL DDL update script that applies changes from one version to the next.

提交回复
热议问题