Hibernate hbm2ddl.auto默认值 [英] Hibernate hbm2ddl.auto default value

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

问题描述

hibernate.hbm2ddl.auto

在hibernate cfg文件映射

in hibernate cfg file mapping

可以删除

<property name="hibernate.hbm2ddl.auto">update</property>

此配置文件的映射

if我删除此属性,不管它是否影响我的DB

if i remove this property whether it affect my DB

推荐答案

p>在创建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.

validate | update | create | create-drop




  • 验证现有架构
  • $ b $

    • validate- existing schema
    • update- only update your schema once created
    • create- create schema every time
    • 这篇关于Hibernate hbm2ddl.auto默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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