hibernate.hbm2ddl.auto 的设置
来源:互联网 发布:淘宝店属于什么行业 编辑:程序博客网 时间:2024/05/11 13:29
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools. --><hibernate-configuration><session-factory><property name="connection.username">root</property><property name="connection.url">jdbc:mysql://localhost:3306/myhibernate</property><property name="dialect">org.hibernate.dialect.MySQLDialect</property><property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hbm2ddl.auto">create</property><property name="c3p0.min_size">5</property><property name="c3p0.max_size">20</property><property name="c3p0.timeout">300</property><property name="c3p0.max_statements">50</property><property name="c3p0.idle_test_period">3000</property><property name="show_sql">true</property><property name="format_sql">true</property><property name="myeclipse.connection.profile">mysql</property><property name="connection.password"></property><mapping resource="hello/Message.hbm.xml" /></session-factory></hibernate-configuration>
alidate 加载hibernate时,验证创建数据库表结构
create 每次加载hibernate,重新创建数据库表结构,这就是导致数据库表数据丢失的原因。
create-drop 加载hibernate时创建,退出是删除表结构
update 加载hibernate自动更新数据库结构
在本机开发调试初始化数据的时候可以选择create、update等。
但是网站发布正式版本的时候,对数据库现有的数据或表结构进行自动的更新是很危险的。此时此刻应该由DBA同志通过手工的方式进行后台的数据库操作。
hibernate.hbm2ddl.auto的值建议是“none”或“validate”。“validate”应该是最好的选择:这样 spring在加载之初,如果model层和数据库表结构不同,就会报错,这样有助于技术运维预先发现问题。
- hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的设置
- 关于hibernate.hbm2ddl.auto 的设置
- 关于hibernate.hbm2ddl.auto 的设置
- hibernate.hbm2ddl.auto 的区别设置
- Hibernate中hbm2ddl.auto设置的问题
- Hibernate的hbm2ddl.auto
- hbm2ddl.auto 的设置
- hibernate的hibernate.hbm2ddl.auto
- hibernate.hbm2ddl.auto的value
- hibernate.hbm2ddl.auto的值
- hibernate.hbm2ddl.auto的值
- hibernate.hbm2ddl.auto的值
- hibernate.hbm2ddl.auto设置成update的问题
- H.264 CodecStream Architechture
- Android唯一识别码
- 广播通信
- Android开发笔记之HelloWord
- 邮箱附件 保存到指定的文件夹
- hibernate.hbm2ddl.auto 的设置
- android init language trigger触发条件分析
- 恢复JFS2文件系统中删除的文件测试过程
- 快速实现拨打电话
- bash 并行命令
- 论模电与爱情
- perl的异常处理die、warn、eval函数--DBI的RaiseError
- 重新整理的一些IC卡资料
- cocos2d之,创建一个有背景颜色的layer