jpa spring.jpa.hibernate.ddl-auto的可选值以及作用(所在类的名称,以及在hibernate文档中的位置)

有以下几个可选值:

none

No action will be performed.(不执行任何操作)

create-only

Database creation will be generated. (仅创建,之前如果有这个表,以及数据,不会删除)

drop

Database dropping will be generated. (删除表)

create

Database dropping will be generated followed by database creation. (实际过程是CREATE( “drop-and-create”, “create” ) 就是先删除,再创建)

create-drop

Drop the schema and recreate it on SessionFactory startup. Additionally, drop the schema on SessionFactory shutdown. (开启session的时候创建,关闭session的时候删除)

validate

Validate the database schema

update

Update the database schema (如果没有这个表,则创建这个表,如果这个实体类,新增了列,数据库中也会增加,但是如果实体减少了类,这里不会减少,是为了数据安全)(这个用的比较多)

java源码在: org.hibernate.tool.schema.Action 类中。

在hibernate文档中的位置如下链接:(这里链接的是hibernate5.2的官网文档)
https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#configurations-hbmddl

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值