hiberante.hbm2ddl.auto参数配置
来源:互联网 发布:linux用vim打开文件 编辑:程序博客网 时间:2024/05/02 03:10
hibernate.cfg.xml的配置:
<?xml version='1.0' encoding='utf-8'?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="connection.driver_class">org.hsqldb.jdbcDriver</property> <property name="connection.url">jdbc:hsqldb:hsql://localhost</property> <property name="connection.username">sa</property> <property name="connection.password"></property> <!-- JDBC connection pool (use the built-in) --> <property name="connection.pool_size">1</property> <!-- SQL dialect --> <property name="dialect">org.hibernate.dialect.HSQLDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <!-- Drop and re-create the database schema on startup --> <property name="hbm2ddl.auto">update</property> <mapping resource="org/hibernate/tutorial/domain/Event.hbm.xml"/> </session-factory></hibernate-configuration>
hibernate.hbm2ddl.auto :可以通过hibernate的*.hbm.xml的配置来动态创建数据库的表结构(通过DDL语言)可配置属性值:create-drop|create|update|validate
create-drop:表示在hebarinate初始化时创建表格,程序运行结束的时候会删除相应的表格
create:在hibernate每次初始化时会都会重新创建表格,在运行结束之后不删除表格
update:只是根据映射文件去验证数据库中的表,如果不一致,就更新表的结构
validate:只是根据映射文件去验证数据库中的表,不一致只是报错而不更新数据库表结构
0 0
- hiberante.hbm2ddl.auto参数配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- 10021---Hibernate配置文件中hiberante.hbm2ddl.auto四个参数的配置
- Hibernate一个配置参数hibernate.hbm2ddl.auto
- Hibernate一个配置参数hibernate.hbm2ddl.auto
- hibernate的hibernate.hbm2ddl.auto配置参数
- hibernate的hibernate.hbm2ddl.auto配置参数
- 【Hibernate】hbm2ddl.auto 参数的配置
- 【hibernate】 hbm2ddl.auto参数
- hibernate.hbm2ddl.auto配置
- hibernate.hbm2ddl.auto配置
- hibernate.hbm2ddl.auto配置
- [iOS 技术]相对布局 获取 UITableView中内容的高度,设置UITableView中内容的高度与UITableView高度相同
- 新手学JavaScript(四)----CheckBox全选与全不选
- [易飞]关于内部备料订单动态跟踪库存和销货量的统计
- 阿里大鱼短信平台使用-Java版
- 建设自己的数据库代码框架
- hiberante.hbm2ddl.auto参数配置
- String字符串的截取
- 图---邻接表(建立,深度遍历,广度遍历)
- 多线程浅析(1)
- Wireshark 过滤条件收集
- 安卓--第二天--页面跳转和数据传递
- eclipse中新建Server服务器,使用Tomcat7
- 用Java实现的多线程扫描IP程序
- Virtualbox The character device /dev/vboxdrv does not exist.